diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2021-10-26 22:41:31 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-01 21:12:58 +0100 |
commit | 55e1edd51ba6880f791f0b34edbdf51dd722a525 (patch) | |
tree | 25e0990f010746c5c66dc9ca08f9d5a042fdaf46 /Meta/export-argsparser-manpages.sh | |
parent | 50a65f02a8d3de8ae9e8cc1fc2ab28edd87983e0 (diff) | |
download | serenity-55e1edd51ba6880f791f0b34edbdf51dd722a525.zip |
Meta: Check auto-generated manpages for completeness on CI
Diffstat (limited to 'Meta/export-argsparser-manpages.sh')
-rwxr-xr-x | Meta/export-argsparser-manpages.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Meta/export-argsparser-manpages.sh b/Meta/export-argsparser-manpages.sh index 64b462c831..e1f11f17ed 100755 --- a/Meta/export-argsparser-manpages.sh +++ b/Meta/export-argsparser-manpages.sh @@ -10,6 +10,20 @@ if ! command -v tar >/dev/null 2>&1 ; then exit 1 fi +if [ "$#" = "0" ]; then + VERIFY_GIT_STATE=n +elif [ "$#" = "1" ] && [ "$1" = "--verify-git-state" ]; then + VERIFY_GIT_STATE=y +else + echo "USAGE: $0 [--verify-git-state]" + echo "This script runs Serenity and exports a set of manpages through ArgsParser," + echo "and places them in Base/usr/share/man/." + echo "If --verify-git-state is given, this script verifies that this does not modify" + echo "the git state, i.e. that all exported manpages already were in the repository" + echo "with the exact same content." + exit 1 +fi + echo "This script assumes passwordless sudo." sudo true @@ -49,3 +63,18 @@ sudo umount fsmount rmdir fsmount echo "Successfully (re-)generated manpages in Base/usr/share/man/" + +if [ "$VERIFY_GIT_STATE" = "y" ]; then + echo "Verifying git state ..." + if [ "" != "$(git clean -n Base/usr/share/man)" ] || ! git diff --quiet Base/usr/share/man; then + echo "Failed: There are missing and/or outdated manpages." + echo "$ git status Base/usr/share/man" + git status Base/usr/share/man + echo "$ git diff Base/usr/share/man" + git diff Base/usr/share/man + echo "You may need to run ./Meta/export-argsparser-manpages.sh on your system and commit/squash the resulting changes." + exit 1 + else + echo "Verified: No missing or outdated manpages. Great!" + fi +fi |