-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added in the check for the version for the manpage
* Added in the the check to see if the manpages should be generated or not * Changed the generate_manpage.yml file so that it sets up the action as needed, and removed some of the things not needed
- Loading branch information
1 parent
7be034f
commit d7b5428
Showing
3 changed files
with
20 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Directory to store the generated manpages | ||
MANPAGE_DIR="man" | ||
# Extract the current version from the spec file in the PR branch | ||
CURRENT_VER=$(grep -oP '^Version:\s+\K\S+' packaging/convert2rhel.spec) | ||
echo "Current version from PR: $CURRENT_VER" | ||
|
||
echo Generating manpages | ||
# Fetch the version from the main branch | ||
MAIN_VER=$(git show origin/main:packaging/convert2rhel.spec | grep -oP '^Version:\s+\K\S+') | ||
echo "Version from main branch: $MAIN_VER" | ||
|
||
VER=$(grep -oP '^Version:\s+\K\S+' packaging/convert2rhel.spec) | ||
|
||
echo Generating for version $VER | ||
# Generate a file with convert2rhel synopsis for argparse-manpage | ||
/usr/bin/python -c 'from convert2rhel import toolopts; print("[synopsis]\n."+toolopts.CLI.usage())' > man/synopsis | ||
|
||
/usr/bin/python -m pip install argparse-manpage six pexpect | ||
|
||
# Generate the manpage using argparse-manpage | ||
PYTHONPATH=. /usr/bin/python /home/runner/.local/bin/argparse-manpage --pyfile man/__init__.py --function get_parser --manual-title="General Commands Manual" --description="Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux." --project-name "convert2rhel $VER" --prog="convert2rhel" --include man/distribution --include man/synopsis > "$MANPAGE_DIR/convert2rhel.8" | ||
|
||
git status | ||
# Compare versions | ||
if [ "$CURRENT_VER" != "$MAIN_VER" ]; then | ||
echo "Version has changed. Please update the manpages." | ||
exit 1 | ||
else | ||
echo "Version is up-to-date." | ||
exit 0 | ||
fi |