Translated using Weblate (Slovak)
[phpmyadmin.git] / scripts / check-release-excludes.sh
blobad85efefaa041bac338a2ece999c9d2bf7d198d0
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/composer/ca-bundle/res/cacert.pem)
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 RELEASE-DATE-[1-9].[0-9]+snapshot)
168 CONTRIBUTING.md)
170 README)
172 favicon.ico)
174 babel.config.json)
176 package.json)
178 composer.json)
180 composer.lock)
182 yarn.lock)
184 .rtlcssrc.json)
186 robots.txt)
188 index.php)
190 url.php)
192 js/messages.php)
194 config.sample.inc.php)
196 show_config_errors.php)
199 foundFileExt
201 esac
205 for filePath in ${FILE_LIST}; do
206 validateExtension
207 case $filePath in
208 */.editorconfig)
209 foundFile;;
210 */easy-coding-standard.neon)
211 foundFile;;
212 */.travis.yml)
213 foundFile;;
214 */psalm.xml)
215 foundFile;;
216 */.coveralls.yml)
217 foundFile;;
218 */appveyor.yml)
219 foundFile;;
220 */phpunit.xml)
221 foundFile;;
222 */phive.xml)
223 foundFile;;
224 */Makefile)
225 foundFile;;
226 */phpbench.json)
227 foundFile;;
228 */phpbench.json.dist)
229 foundFile;;
230 */.php-cs-fixer.dist.php)
231 foundFile;;
232 */.php_cs)
233 foundFile;;
234 */.php_cs.dist)
235 foundFile;;
236 */.php_cs.cache)
237 foundFile;;
238 */psalm.xml)
239 foundFile;;
240 */phpstan.neon)
241 foundFile;;
242 */phpstan.neon)
243 foundFile;;
244 */phpcs.xml.dist)
245 foundFile;;
246 */phpunit.xml.dist)
247 foundFile;;
248 */.scrutinizer.yml)
249 foundFile;;
250 */codecov.yml)
251 foundFile;;
252 */.gitattributes)
253 foundFile;;
254 */.gitignore)
255 foundFile;;
256 */infection.json.dist)
257 foundFile;;
258 */infection.json)
259 foundFile;;
260 */infection.json.dist)
261 foundFile;;
262 */makefile)
263 foundFile;;
264 */Makefile)
265 foundFile;;
266 */.phpunit.result.cache)
267 foundFile;;
268 */phpstan.neon.dist)
269 foundFile;;
270 */phpstan-baseline.neon)
271 foundFile;;
272 */phpmd.xml.dist)
273 foundFile;;
274 */.travis.php.ini)
275 foundFile;;
276 */vendor/*/tests/*)
277 foundFile;;
278 */vendor/*/Tests/*)
279 foundFile;;
280 */vendor/*/test/*)
281 foundFile;;
282 */twig/twig/lib/Twig/Node/Expression/Test/*)
284 */twig/twig/lib/Twig/Test/*)
286 *twig/twig/src/Node/Expression/Test/*)
288 */vendor/*/Test/*)
289 foundFile;;
290 */.dependabot/*)
291 foundFile;;
292 */.github/*)
293 foundFile;;
294 */.circleci/*)
295 foundFile;;
296 */vendor/examples/*)
297 foundFile;;
298 */.git/*)
299 foundFile;;
300 *vendor/*.rst)
301 foundFile;;
302 *vendor/*.po)
303 foundFile;;
304 *vendor/*.pot)
305 foundFile;;
306 *vendor/*.m4)
307 foundFile;;
308 *vendor/*.c)
309 foundFile;;
310 *vendor/*.h)
311 foundFile;;
312 *vendor/*.sh)
313 foundFile;;
314 *vendor/*.w32)
315 foundFile;;
316 *.hhconfig)
317 foundFile;;
318 *.hhi)
319 foundFile;;
320 *.xsd)
321 foundFile;;
322 *.xml)
323 foundFile;;
324 *vendor/*CONTRIBUTING.md*)
325 foundFile;;
326 *CODE_OF_CONDUCT.md*)
327 foundFile;;
328 *PERFORMANCE.md*)
329 foundFile;;
330 *phar*)
331 foundFile;;
332 *) ;;
333 esac
334 done
336 if [ ${found} -gt 0 ]; then
337 echo 'Some new files to be excluded where found.'
338 echo 'Please update create-release.sh'
339 exit 1
340 else
341 echo 'Everything looks okay'
342 exit 0