Translated using Weblate (Serbian)
[phpmyadmin.git] / scripts / check-release-excludes.sh
blob0bc43fb7d65fb451f824b9e8150024fd83951e93
1 #!/bin/bash
3 set -e
5 FILE="$1"
7 if [ ! -f "${FILE}" ]; then
8 echo 'Please provide a file as a first argument.'
9 exit 1
12 FILE_LIST="$(tar --list --file="${FILE}")"
14 found=0;
16 echo 'Searching for files'
18 foundFile() {
19 found=1
20 printf "Found: %s\n" "${filePath}"
23 foundFileExt() {
24 found=1
25 printf "Found unexpected file: %s with extension %s\n" "${pathWithoutFirst}" "${extension}"
28 validateExtension() {
29 if [ "${filePath: -1}" = "/" ]; then
30 return;
33 pathWithoutFirst="$(echo "$filePath" | cut -d / -f 2-)"
35 filename=$(basename -- "$pathWithoutFirst")
36 extension="${filename##*.}"
38 case $pathWithoutFirst in
39 doc/*)
40 if [ \
41 "${extension}" != "png" -a "${extension}" != "txt" \
42 -a "${extension}" != "html" -a "${extension}" != "js" \
43 -a "${extension}" != "css" -a "${extension}" != "gif" \
44 ]; then
45 foundFileExt
48 js/vendor/*)
49 if [ \
50 "${extension}" != "js" -a "${extension}" != "map" \
51 -a "${extension}" != "css" -a "${filename}" != "LICENSE" \
52 -a "${extension}" != "txt" \
53 ]; then
54 foundFileExt
57 js/config/*)
58 if [ "${extension}" != "js" ];then
59 foundFileExt
62 js/dist/*)
63 if [ "${extension}" != "js" ];then
64 foundFileExt
67 js/src/*)
68 if [ \
69 "${extension}" != "js" -a "${extension}" != "mjs" \
70 ]; then
71 foundFileExt
74 sql/*)
75 if [ "${extension}" != "sql" ]; then
76 foundFileExt
79 examples/*)
80 if [ "${extension}" != "php" ]; then
81 foundFileExt
84 locale/*)
85 if [ "${extension}" != "mo" ]; then
86 foundFileExt
89 setup/*)
90 if [ \
91 "${extension}" != "php" -a "${extension}" != "twig" \
92 -a "${extension}" != "css" \
93 -a "${extension}" != "scss" -a "${extension}" != "gif" -a "${extension}" != "map" \
94 ]; then
95 foundFileExt
98 templates/*)
99 if [ "${extension}" != "twig" ]; then
100 foundFileExt
103 libraries/*)
104 if [ \
105 "${extension}" != "php" -a "${extension}" != "md" \
106 -a "${filename}" != "README" \
107 -a "${filename}" != "TEMPLATE" -a "${filename}" != "TEMPLATE_ABSTRACT" \
108 ]; then
109 foundFileExt
112 themes/*)
113 if [ \
114 "${extension}" != "css" -a "${extension}" != "png" \
115 -a "${extension}" != "scss" -a "${extension}" != "map" \
116 -a "${extension}" != "svg" -a "${extension}" != "ico" \
117 -a "${extension}" != "gif" -a "${extension}" != "json" \
118 ]; then
119 foundFileExt
122 vendor/phpmyadmin/sql-parser/locale/*)
123 if [ "${extension}" != "mo" ]; then
124 foundFileExt
127 vendor/phpseclib/phpseclib/phpseclib/openssl.cnf)
129 vendor/pragmarx/google2fa-qrcode/composer.lock)
131 vendor/williamdes/mariadb-mysql-kbs/dist/merged-ultraslim.json)
133 vendor/composer/installed.json)
135 vendor/tecnickcom/tcpdf/*)
136 if [ \
137 "${extension}" != "php" -a "${filename}" != "LICENSE.TXT" \
138 -a "${filename}" != "README.md" -a "${filename}" != "CHANGELOG.TXT" \
139 -a "${filename}" != "VERSION" -a "${filename}" != "composer.json" \
140 -a "${extension}" != "z" \
141 ]; then
142 foundFileExt
145 vendor/*)
146 if [ \
147 "${extension}" != "php" -a "${filename}" != "LICENSE" \
148 -a "${filename}" != "README" -a "${filename}" != "CHANGELOG" \
149 -a "${filename}" != "composer.json" -a "${filename}" != "CHANGELOG.md" \
150 -a "${filename}" != "README.md" -a "${filename}" != "BACKERS.md" \
151 -a "${filename}" != "LICENSE.md" -a "${filename}" != "ARCHITECTURE.md" \
152 -a "${filename}" != "LICENSE.txt" -a "${filename}" != "AUTHORS" \
153 -a "${filename}" != "LICENCE.md" -a "${filename}" != "LICENCE" \
154 ]; then
155 foundFileExt
158 ChangeLog)
160 LICENSE)
162 RELEASE-DATE-[1-9].[0-9].[0-9])
164 RELEASE-DATE-[1-9].[0-9].[0-9]-dev)
166 CONTRIBUTING.md)
168 README)
170 favicon.ico)
172 babel.config.json)
174 package.json)
176 composer.json)
178 composer.lock)
180 yarn.lock)
182 .rtlcssrc.json)
184 robots.txt)
186 index.php)
188 url.php)
190 js/messages.php)
192 config.sample.inc.php)
194 show_config_errors.php)
197 foundFileExt
199 esac
203 for filePath in ${FILE_LIST}; do
204 validateExtension
205 case $filePath in
206 */.editorconfig)
207 foundFile;;
208 */easy-coding-standard.neon)
209 foundFile;;
210 */.travis.yml)
211 foundFile;;
212 */psalm.xml)
213 foundFile;;
214 */.coveralls.yml)
215 foundFile;;
216 */appveyor.yml)
217 foundFile;;
218 */phpunit.xml)
219 foundFile;;
220 */phive.xml)
221 foundFile;;
222 */Makefile)
223 foundFile;;
224 */phpbench.json)
225 foundFile;;
226 */phpbench.json.dist)
227 foundFile;;
228 */.php-cs-fixer.dist.php)
229 foundFile;;
230 */.php_cs)
231 foundFile;;
232 */.php_cs.dist)
233 foundFile;;
234 */.php_cs.cache)
235 foundFile;;
236 */psalm.xml)
237 foundFile;;
238 */phpstan.neon)
239 foundFile;;
240 */phpstan.neon)
241 foundFile;;
242 */phpcs.xml.dist)
243 foundFile;;
244 */phpunit.xml.dist)
245 foundFile;;
246 */.scrutinizer.yml)
247 foundFile;;
248 */codecov.yml)
249 foundFile;;
250 */.gitattributes)
251 foundFile;;
252 */.gitignore)
253 foundFile;;
254 */infection.json.dist)
255 foundFile;;
256 */infection.json)
257 foundFile;;
258 */infection.json.dist)
259 foundFile;;
260 */makefile)
261 foundFile;;
262 */Makefile)
263 foundFile;;
264 */.phpunit.result.cache)
265 foundFile;;
266 */phpstan.neon.dist)
267 foundFile;;
268 */phpstan-baseline.neon)
269 foundFile;;
270 */phpmd.xml.dist)
271 foundFile;;
272 */.travis.php.ini)
273 foundFile;;
274 */vendor/*/tests/*)
275 foundFile;;
276 */vendor/*/Tests/*)
277 foundFile;;
278 */vendor/*/test/*)
279 foundFile;;
280 */twig/twig/lib/Twig/Node/Expression/Test/*)
282 */twig/twig/lib/Twig/Test/*)
284 *twig/twig/src/Node/Expression/Test/*)
286 */vendor/*/Test/*)
287 foundFile;;
288 */.dependabot/*)
289 foundFile;;
290 */.github/*)
291 foundFile;;
292 */.circleci/*)
293 foundFile;;
294 */vendor/examples/*)
295 foundFile;;
296 */.git/*)
297 foundFile;;
298 *vendor/*.rst)
299 foundFile;;
300 *vendor/*.po)
301 foundFile;;
302 *vendor/*.pot)
303 foundFile;;
304 *vendor/*.m4)
305 foundFile;;
306 *vendor/*.c)
307 foundFile;;
308 *vendor/*.h)
309 foundFile;;
310 *vendor/*.sh)
311 foundFile;;
312 *vendor/*.w32)
313 foundFile;;
314 *.hhconfig)
315 foundFile;;
316 *.hhi)
317 foundFile;;
318 *.xsd)
319 foundFile;;
320 *.xml)
321 foundFile;;
322 *vendor/*CONTRIBUTING.md*)
323 foundFile;;
324 *CODE_OF_CONDUCT.md*)
325 foundFile;;
326 *PERFORMANCE.md*)
327 foundFile;;
328 *) ;;
329 esac
330 done
332 if [ ${found} -gt 0 ]; then
333 echo 'Some new files to be excluded where found.'
334 echo 'Please update create-release.sh'
335 exit 1
336 else
337 echo 'Everything looks okay'
338 exit 0