| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# NOTE: should be synced with debian/rspamd.triggers |
| 4 |
|
| 5 |
set -eu |
| 6 |
|
| 7 |
test_file() |
| 8 |
{ |
| 9 |
FILE=$1 |
| 10 |
if [ ! -f "$FILE" ]; then |
| 11 |
echo "File '$FILE' not found!" |
| 12 |
exit 1 |
| 13 |
fi |
| 14 |
echo "File '$FILE' found." |
| 15 |
|
| 16 |
REALPATH=$(realpath -e "$FILE") || true |
| 17 |
if [ "$REALPATH" != "$FILE" ]; then |
| 18 |
if [ $# -eq 1 ]; then |
| 19 |
echo "Path '$FILE' does not equal its resolved path: '$REALPATH!" |
| 20 |
exit 1; |
| 21 |
fi |
| 22 |
|
| 23 |
ALTERNATIVE_FILE=$2 |
| 24 |
if [ "$REALPATH" != "$ALTERNATIVE_FILE" ]; then |
| 25 |
echo "Path '$FILE' does neither equal its resolved path nor its alternative path '$ALTERNATIVE_FILE': '$REALPATH!" |
| 26 |
exit 1 |
| 27 |
fi |
| 28 |
echo "Path '$FILE' equals its alternative path '$ALTERNATIVE_FILE'." |
| 29 |
else |
| 30 |
echo "Path '$FILE' equals its resolved path." |
| 31 |
fi |
| 32 |
} |
| 33 |
|
| 34 |
echo "Start checking files..." |
| 35 |
|
| 36 |
test_file /usr/share/javascript/bootstrap5/js/bootstrap.bundle.min.js /usr/share/bootstrap-html/js/bootstrap.bundle.min.js |
| 37 |
test_file /usr/share/javascript/bootstrap5/css/bootstrap.min.css /usr/share/bootstrap-html/css/bootstrap.min.css |
| 38 |
test_file /usr/share/javascript/jquery/jquery.min.js /usr/share/nodejs/jquery/dist/jquery.min.js |
| 39 |
test_file /usr/share/javascript/requirejs/require.js |
| 40 |
|
| 41 |
echo "Finished checking files." |