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