Translated using Weblate (Slovenian)
[phpmyadmin.git] / scripts / check-release-excludes.sh
blob9592ee1a5608e746cf5271ad7698ebba4221ff88
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/global.d.ts)
50 js/vendor/*)
51 if [ \
52 "${extension}" != "js" -a "${extension}" != "map" \
53 -a "${extension}" != "css" -a "${filename}" != "LICENSE" \
54 -a "${extension}" != "txt" \
55 ]; then
56 foundFileExt
59 js/dist/*)
60 if [ \
61 "${extension}" != "js" -a "${extension}" != "map" \
62 ]; then
63 foundFileExt
66 js/config/*)
67 if [ "${extension}" != "js" ];then
68 foundFileExt
71 js/dist/*)
72 if [ "${extension}" != "js" ];then
73 foundFileExt
76 js/src/*)
77 if [ \
78 "${extension}" != "js" -a "${extension}" != "mjs" \
79 ]; then
80 foundFileExt
83 sql/*)
84 if [ "${extension}" != "sql" ]; then
85 foundFileExt
88 examples/*)
89 if [ "${extension}" != "php" ]; then
90 foundFileExt
93 locale/*)
94 if [ "${extension}" != "mo" ]; then
95 foundFileExt
98 setup/*)
99 if [ \
100 "${extension}" != "php" -a "${extension}" != "twig" \
101 -a "${extension}" != "css" \
102 -a "${extension}" != "scss" -a "${extension}" != "gif" -a "${extension}" != "map" \
103 ]; then
104 foundFileExt
107 templates/*)
108 if [ "${extension}" != "twig" ]; then
109 foundFileExt
112 libraries/*)
113 if [ \
114 "${extension}" != "php" -a "${extension}" != "md" \
115 -a "${filename}" != "README" \
116 -a "${filename}" != "TEMPLATE" -a "${filename}" != "TEMPLATE_ABSTRACT" \
117 ]; then
118 foundFileExt
121 themes/*)
122 if [ \
123 "${extension}" != "css" -a "${extension}" != "png" \
124 -a "${extension}" != "scss" -a "${extension}" != "map" \
125 -a "${extension}" != "svg" -a "${extension}" != "ico" \
126 -a "${extension}" != "gif" -a "${extension}" != "json" \
127 ]; then
128 foundFileExt
131 vendor/phpmyadmin/sql-parser/locale/*)
132 if [ "${extension}" != "mo" ]; then
133 foundFileExt
136 vendor/composer/ca-bundle/res/cacert.pem)
138 vendor/pragmarx/google2fa-qrcode/composer.lock)
140 vendor/williamdes/mariadb-mysql-kbs/dist/merged-ultraslim.json)
142 vendor/composer/installed.json)
144 vendor/tecnickcom/tcpdf/*)
145 if [ \
146 "${extension}" != "php" -a "${filename}" != "LICENSE.TXT" \
147 -a "${filename}" != "README.md" -a "${filename}" != "CHANGELOG.TXT" \
148 -a "${filename}" != "VERSION" -a "${filename}" != "composer.json" \
149 -a "${extension}" != "z" \
150 ]; then
151 foundFileExt
154 vendor/*)
155 if [ \
156 "${extension}" != "php" -a "${filename}" != "LICENSE" \
157 -a "${filename}" != "README" -a "${filename}" != "CHANGELOG" \
158 -a "${filename}" != "composer.json" -a "${filename}" != "CHANGELOG.md" \
159 -a "${filename}" != "README.md" -a "${filename}" != "BACKERS.md" \
160 -a "${filename}" != "LICENSE.md" -a "${filename}" != "ARCHITECTURE.md" \
161 -a "${filename}" != "LICENSE.txt" -a "${filename}" != "AUTHORS" \
162 -a "${filename}" != "LICENCE.md" -a "${filename}" != "LICENCE" \
163 ]; then
164 foundFileExt
167 ChangeLog)
169 LICENSE)
171 RELEASE-DATE-[1-9].[0-9].[0-9])
173 RELEASE-DATE-[1-9].[0-9].[0-9]-dev)
175 RELEASE-DATE-[1-9].[0-9]+snapshot)
177 CONTRIBUTING.md)
179 README)
181 favicon.ico)
183 tsconfig.json)
185 webpack.config.cjs)
187 package.json)
189 composer.json)
191 composer.lock)
193 yarn.lock)
195 robots.txt)
197 index.php)
199 config.sample.inc.php)
201 show_config_errors.php)
204 foundFileExt
206 esac
210 for filePath in ${FILE_LIST}; do
211 validateExtension
212 case $filePath in
213 */rector*.php)
214 foundFile;;
215 */.gitkeep)
216 foundFile;;
217 */.editorconfig)
218 foundFile;;
219 */easy-coding-standard.neon)
220 foundFile;;
221 */.travis.yml)
222 foundFile;;
223 */psalm.xml)
224 foundFile;;
225 */.coveralls.yml)
226 foundFile;;
227 */appveyor.yml)
228 foundFile;;
229 */phpunit.xml)
230 foundFile;;
231 */phive.xml)
232 foundFile;;
233 */Makefile)
234 foundFile;;
235 */phpbench.json)
236 foundFile;;
237 */phpbench.json.dist)
238 foundFile;;
239 */.php-cs-fixer.dist.php)
240 foundFile;;
241 */.php_cs)
242 foundFile;;
243 */.php_cs.dist)
244 foundFile;;
245 */.php_cs.cache)
246 foundFile;;
247 */psalm.xml)
248 foundFile;;
249 */phpstan.neon)
250 foundFile;;
251 */phpstan.neon)
252 foundFile;;
253 */phpcs.xml.dist)
254 foundFile;;
255 */phpunit.xml.dist)
256 foundFile;;
257 */.scrutinizer.yml)
258 foundFile;;
259 */codecov.yml)
260 foundFile;;
261 */.gitattributes)
262 foundFile;;
263 */.gitignore)
264 foundFile;;
265 */infection.json.dist)
266 foundFile;;
267 */infection.json)
268 foundFile;;
269 */infection.json.dist)
270 foundFile;;
271 */makefile)
272 foundFile;;
273 */Makefile)
274 foundFile;;
275 */.phpunit.result.cache)
276 foundFile;;
277 */phpstan.neon.dist)
278 foundFile;;
279 */phpstan-baseline.neon)
280 foundFile;;
281 */phpmd.xml.dist)
282 foundFile;;
283 */.travis.php.ini)
284 foundFile;;
285 */vendor/*/tests/*)
286 foundFile;;
287 */vendor/*/Tests/*)
288 foundFile;;
289 */vendor/*/test/*)
290 foundFile;;
291 */twig/twig/lib/Twig/Node/Expression/Test/*)
293 */twig/twig/lib/Twig/Test/*)
295 *twig/twig/src/Node/Expression/Test/*)
297 */vendor/*/Test/*)
298 foundFile;;
299 */.dependabot/*)
300 foundFile;;
301 */.github/*)
302 foundFile;;
303 */.circleci/*)
304 foundFile;;
305 */vendor/examples/*)
306 foundFile;;
307 */.git/*)
308 foundFile;;
309 *vendor/*.rst)
310 foundFile;;
311 *vendor/*.po)
312 foundFile;;
313 *vendor/*.pot)
314 foundFile;;
315 *vendor/*.m4)
316 foundFile;;
317 *vendor/*.c)
318 foundFile;;
319 *vendor/*.h)
320 foundFile;;
321 *vendor/*.sh)
322 foundFile;;
323 *vendor/*.w32)
324 foundFile;;
325 *.hhconfig)
326 foundFile;;
327 *.hhi)
328 foundFile;;
329 *.xsd)
330 foundFile;;
331 *.xml)
332 foundFile;;
333 *vendor/*CONTRIBUTING.md*)
334 foundFile;;
335 *CODE_OF_CONDUCT.md*)
336 foundFile;;
337 *PERFORMANCE.md*)
338 foundFile;;
339 *phar*)
340 foundFile;;
341 *) ;;
342 esac
343 done
345 if [ ${found} -gt 0 ]; then
346 echo 'Some new files to be excluded where found.'
347 echo 'Please update create-release.sh'
348 exit 1
349 else
350 echo 'Everything looks okay'
351 exit 0