| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
RESULT=0 |
| 4 |
|
| 5 |
check_file() { |
| 6 |
local TARGET_FILE="$1" |
| 7 |
echo -n "Checking file $TARGET_FILE" |
| 8 |
if ! [ -f "$TARGET_FILE" ]; then |
| 9 |
echo " MISSING" |
| 10 |
return 1 |
| 11 |
else |
| 12 |
echo " OK" |
| 13 |
fi |
| 14 |
return 0 |
| 15 |
} |
| 16 |
|
| 17 |
if ! [ -d /usr/lib/python3/dist-packages/mkdocs ]; then |
| 18 |
echo "Cannot read /usr/lib/python3/dist-packages/mkdocs" >&2 |
| 19 |
exit 1 |
| 20 |
fi |
| 21 |
|
| 22 |
if ! [ -d /usr/share/doc/mkdocs ]; then |
| 23 |
echo "Cannot read /usr/share/doc/mkdocs" >&2 |
| 24 |
exit 2 |
| 25 |
fi |
| 26 |
|
| 27 |
echo "Checking mkdocs links:" |
| 28 |
BASE_DIR="/usr/lib/python3/dist-packages/mkdocs" |
| 29 |
|
| 30 |
check_file "$BASE_DIR/themes/mkdocs/js/bootstrap.bundle.min.js" || RESULT=3 |
| 31 |
check_file "$BASE_DIR/themes/mkdocs/js/bootstrap.bundle.min.js.map" || RESULT=3 |
| 32 |
check_file "$BASE_DIR/themes/mkdocs/css/bootstrap.min.css" || RESULT=3 |
| 33 |
check_file "$BASE_DIR/themes/mkdocs/css/bootstrap.min.css.map" || RESULT=3 |
| 34 |
check_file "$BASE_DIR/themes/readthedocs/js/jquery-3.6.0.min.js" || RESULT=3 |
| 35 |
check_file "$BASE_DIR/contrib/search/templates/search/lunr.js" || RESULT=3 |
| 36 |
check_file "$BASE_DIR/themes/readthedocs/css/theme.css" || RESULT=3 |
| 37 |
check_file "$BASE_DIR/themes/readthedocs/js/theme.js" || RESULT=3 |
| 38 |
|
| 39 |
echo "Checking mkdocs-doc links:" |
| 40 |
BASE_DIR="/usr/share/doc/mkdocs/html" |
| 41 |
check_file "$BASE_DIR/js/bootstrap.bundle.min.js" || RESULT=4 |
| 42 |
check_file "$BASE_DIR/js/bootstrap.bundle.min.js.map" || RESULT=4 |
| 43 |
check_file "$BASE_DIR/css/bootstrap.min.css" || RESULT=4 |
| 44 |
check_file "$BASE_DIR/css/bootstrap.min.css.map" || RESULT=4 |
| 45 |
check_file "$BASE_DIR/js/jquery-3.6.0.min.js" || RESULT=4 |
| 46 |
check_file "$BASE_DIR/search/lunr.js" || RESULT=4 |
| 47 |
|
| 48 |
exit "$RESULT" |