Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RHELC-1748] Manpage generation check #1422

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
fdb6c3f
Added in the check for the version for the manpage
Andrew-ang9 Nov 4, 2024
8605004
Added in a check to see if the manpages
Andrew-ang9 Nov 9, 2024
2cf6892
removed the check for the version
Andrew-ang9 Nov 11, 2024
d750568
Fixed the action
Andrew-ang9 Nov 12, 2024
fe28782
Added rpm to the other dependencies being installed
Andrew-ang9 Nov 20, 2024
674ad99
edited the command for generating the manpages
Andrew-ang9 Nov 20, 2024
773de3c
changed how cli calls the attribues from rpm.py
Andrew-ang9 Nov 21, 2024
c0c1754
added in the config files in the action
Andrew-ang9 Nov 24, 2024
1400d37
added in the installation of rpm to the action
Andrew-ang9 Nov 24, 2024
148906c
used the rpm-py-install to get rpm
Andrew-ang9 Nov 24, 2024
f30d20e
change to using spt-get for rpm
Andrew-ang9 Nov 24, 2024
6ea158e
draft looking to see if rpm and python-rpm are installed
Andrew-ang9 Nov 24, 2024
1350c41
added the use of a podman container
Andrew-ang9 Nov 24, 2024
52e85d0
added the right name for the container file
Andrew-ang9 Nov 24, 2024
b8dbd5b
fixed the containerfiles dir spelling in the action
Andrew-ang9 Nov 24, 2024
39e6fd7
draft specfied the container file path
Andrew-ang9 Nov 24, 2024
2c92f8a
draft added in a virtual enviorment to the container
Andrew-ang9 Nov 24, 2024
424f1de
draft set the path for the manpage_generation.sh file
Andrew-ang9 Nov 24, 2024
6665577
draft added in git and libpopt-dev in the install
Andrew-ang9 Nov 24, 2024
3ee77a9
draft installing rpm in the virtual env
Andrew-ang9 Nov 24, 2024
5746eae
draft install python dev headers
Andrew-ang9 Nov 24, 2024
da0033f
removing the rpm_py_installer
Andrew-ang9 Nov 24, 2024
752aeb4
draft install python3-rpm system wide
Andrew-ang9 Nov 24, 2024
a2d3579
draft using a pre-configured base image
Andrew-ang9 Nov 24, 2024
001fbde
draft changed out the virtual env being installed
Andrew-ang9 Nov 24, 2024
512bff3
draft more installations for rpm
Andrew-ang9 Nov 24, 2024
e7b219f
removed the virtual envorment
Andrew-ang9 Nov 25, 2024
6b772ee
changed from using rpm-python to python3-rpm
Andrew-ang9 Nov 25, 2024
5e95a96
added in six into the packages to be installed
Andrew-ang9 Nov 25, 2024
46750a7
Added in getting the current config file into the container
Andrew-ang9 Nov 25, 2024
88f9585
added in a check to see if the config file is there
Andrew-ang9 Nov 25, 2024
890a422
added in the path for the config file
Andrew-ang9 Nov 25, 2024
7bc9014
edited the config.ini files path
Andrew-ang9 Nov 25, 2024
5168edb
another fix for the path
Andrew-ang9 Nov 25, 2024
1ceefaf
draft change the path
Andrew-ang9 Nov 25, 2024
8fcf22d
draft removed the check for the ini file
Andrew-ang9 Nov 25, 2024
89924ca
draft readded back the install for six
Andrew-ang9 Nov 25, 2024
71e912d
draft fix the import for utils.py
Andrew-ang9 Nov 25, 2024
d4d9c91
fixed the imprort for tool_opts in cli.py
Andrew-ang9 Nov 25, 2024
bf98f70
draft check to see the path for the config file
Andrew-ang9 Nov 25, 2024
27c5eec
draft changed to do all of the work in the action
Andrew-ang9 Nov 26, 2024
d4dadff
removed the installation of rpm-python
Andrew-ang9 Nov 26, 2024
b0e6327
Removed the virtual enviorment as its not needed
Andrew-ang9 Nov 26, 2024
632ee69
added in a check to see if pexpect is in the action
Andrew-ang9 Nov 26, 2024
7dbc24d
added in the verification for rpm
Andrew-ang9 Nov 26, 2024
e5325da
added universe repo as it has the packages
Andrew-ang9 Nov 26, 2024
859773d
changed to use python3-rpm
Andrew-ang9 Nov 26, 2024
d6fb1a7
added a manuel install of rpm and python bindings
Andrew-ang9 Nov 27, 2024
419689d
added in the install NSPR and NSS development
Andrew-ang9 Nov 27, 2024
3efe1d6
seperated commands to make sure they run properly
Andrew-ang9 Nov 27, 2024
045404a
added in the installation of libnpipt-dev
Andrew-ang9 Nov 27, 2024
184b95f
added in libarchive-dev to get the rest of the packages
Andrew-ang9 Nov 27, 2024
5c8ace0
added in libdb-dev for db.h
Andrew-ang9 Nov 27, 2024
f702d2e
set an updated version of python for 3.10
Andrew-ang9 Nov 27, 2024
cd67883
added in setting the env vars per the action
Andrew-ang9 Nov 27, 2024
874e81a
added to the installations a way to disable lua
Andrew-ang9 Nov 27, 2024
37af56b
drafr added the download for all the depencies for rpm
Andrew-ang9 Nov 27, 2024
b07b946
added in the install for six
Andrew-ang9 Nov 27, 2024
92a478d
removed an extra "()" on line 138
Andrew-ang9 Nov 27, 2024
084e04c
fixed the path for cli in the action
Andrew-ang9 Nov 27, 2024
c1fac74
fix the import for cli
Andrew-ang9 Nov 27, 2024
5dd979a
fixed the use of the class for cli
Andrew-ang9 Nov 27, 2024
0794325
reveted the recent change for the cli path
Andrew-ang9 Nov 27, 2024
22b6c57
added some debug messages to fix the issue
Andrew-ang9 Nov 27, 2024
15052d9
added in six
Andrew-ang9 Nov 27, 2024
82a8924
reverted back to old commit
Andrew-ang9 Nov 27, 2024
b5f7d7a
added in some debug statments
Andrew-ang9 Nov 28, 2024
3a26cb0
added the install for six
Andrew-ang9 Nov 28, 2024
e88f0dc
reverted back a bit
Andrew-ang9 Nov 28, 2024
33bd3a9
makes a balnk convert2rhel.ini file
Andrew-ang9 Dec 3, 2024
a63333b
added placeholder stuff in the convert2rhel.ini
Andrew-ang9 Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 83 additions & 23 deletions .github/workflows/generate_manpage.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,93 @@
name: Generate Manpages
name: Update Manpages

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
generate-manpages:
update-manpages:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.10.13

- name: Install dependencies
run: |
pip install argparse-manpage six pexpect

- name: Install python3-rpm and python3-dnf package with apt-get
run: |
sudo apt-get update
sudo apt-get install -y python3-rpm python3-dnf

- name: Generate Manpages
run: |
chmod +x scripts/manpage_generation.sh
bash scripts/manpage_generation.sh
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Add Universe Repository
run: |
sudo add-apt-repository universe
sudo apt-get update

- name: Install dependencies
run: |
sudo apt-get install -y python3-pip rpm libnspr4-dev libnss3-dev libpopt-dev libarchive-dev libdb-dev \
autoconf automake bison flex gettext libtool pkg-config
pip install --upgrade pip
pip install pexpect argparse-manpage six

- name: Download and install RPM
run: |
wget http://ftp.rpm.org/releases/rpm-4.14.x/rpm-4.14.2.tar.bz2
tar -xjf rpm-4.14.2.tar.bz2
cd rpm-4.14.2
export PKG_CONFIG_PATH=/opt/hostedtoolcache/Python/3.10.15/x64/lib/pkgconfig
export PYTHON_CFLAGS="-I/opt/hostedtoolcache/Python/3.10.15/x64/include/python3.10"
export PYTHON_LIBS="-L/opt/hostedtoolcache/Python/3.10.15/x64/lib -lpython3.10"
./configure --disable-nls --enable-python --without-lua
make
sudo make install
cd python
python3 setup.py install
sudo ldconfig

- name: Verify Python Path
run: |
python -c "import sys; print(sys.path)"
python -c "import pexpect; print('pexpect module is available.')"
python -c "import rpm; print('rpm module is available.')"

- name: Debug CLI Attribute
run: |
python -c "import convert2rhel.cli as cli; print(dir(cli)); print(cli.CLI)" || exit 1

- name: Generate manpages
run: |
set -e

# Directory to store the generated manpages
MANPAGE_DIR='man'

# Ensure the manpage directory exists
mkdir -p "$MANPAGE_DIR"

echo 'Generating manpages'

# Add debug statements
python -c 'import convert2rhel.cli as cli; print(dir(cli)); print(cli.CLI)' || exit 1

# Generate a file with convert2rhel synopsis for argparse-manpage
python -c 'from convert2rhel.cli import CLI; print("[synopsis]\n."+CLI.usage())' > "$MANPAGE_DIR/synopsis"

# Extract the current version from the spec file
CURRENT_VER=$(grep -oP '^Version:\s+\K\S+' packaging/convert2rhel.spec)
echo 'Current version: $CURRENT_VER'

# Generate the manpage using argparse-manpage
PYTHONPATH=. 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 $CURRENT_VER' --prog='convert2rhel' --include man/distribution --include man/synopsis > "$MANPAGE_DIR/convert2rhel.8"

# Check for differences in the generated manpage
if ! git diff --quiet HEAD -- "$MANPAGE_DIR/convert2rhel.8"; then
echo 'Manpages are outdated. Please update them.'
exit 1
else
echo 'Manpages are up-to-date.'
exit 0
fi
34 changes: 34 additions & 0 deletions Containerfiles/manpage_check.Containerfile
Copy link
Member

@Venefilyn Venefilyn Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the workflow is not using a container or the script. But if this container works locally it's just a matter of running it in the GitHub workflow

Since we don't need the results exported in any way, but rather to exit the container with a code if there is a change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked about this PR with Mb, and they suggested that if everything could just be done in the action, that could fix some of the issues that I was having. The action works as it should. The error shown now is a separate issue from this PR, but you can see that at the end of it, it does show the correct message for the manpages, as currently, in this PR, there are changes in the manpages file.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Use the latest Fedora image as the base
FROM quay.io/fedora/fedora:latest

# Install system dependencies
RUN dnf install -y \
python3 \
python3-pip \
python3-devel \
rpm-devel \
python3-rpm \
git \
&& dnf clean all

# Install Python packages
RUN pip3 install --upgrade pip
RUN pip3 install pexpect argparse-manpage six

# Set the working directory
WORKDIR /app

# Copy the project files into the container
COPY . /app

# Copy the convert2rhel.ini configuration file into the container
COPY config/convert2rhel.ini /etc/convert2rhel/convert2rhel.ini

# Copy manpage_generation.sh from the scripts directory into the container
COPY scripts/manpage_generation.sh /app/

# Ensure the script is executable
RUN chmod +x /app/manpage_generation.sh

# Set up entrypoint to run manpage_generation.sh
ENTRYPOINT ["/app/manpage_generation.sh"]
5 changes: 3 additions & 2 deletions convert2rhel/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
import sys

from convert2rhel import __version__, utils
from convert2rhel.toolopts import tool_opts
from convert2rhel.toolopts.__init__ import tool_opts
from convert2rhel.toolopts.config import CliConfig, FileConfig
from convert2rhel.utils.rpm import PRE_RPM_VA_LOG_FILENAME, POST_RPM_VA_LOG_FILENAME


loggerinst = logging.getLogger(__name__)
Expand Down Expand Up @@ -134,7 +135,7 @@ def _register_options(self):
" to show you what rpm files have been affected by the conversion."
" Cannot be used with analyze subcommand."
" The incomplete_rollback option needs to be set to true in the /etc/convert2rhel.ini config file to"
" use this argument.".format(utils.rpm.PRE_RPM_VA_LOG_FILENAME, utils.rpm.POST_RPM_VA_LOG_FILENAME),
" use this argument.".format(PRE_RPM_VA_LOG_FILENAME, POST_RPM_VA_LOG_FILENAME),
)
self._shared_options_parser.add_argument(
"--eus",
Expand Down
1 change: 1 addition & 0 deletions convert2rhel/toolopts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def options_from_config_files(self):
# (meaning that the user entered something through the `-c` option), we
# will use only that, as it has a higher priority over the rest
paths = [os.path.expanduser(path) for path in self._config_files if os.path.exists(os.path.expanduser(path))]
print(paths)

if not paths:
raise FileNotFoundError("No such file or directory: {}".format(", ".join(paths)))
Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

from convert2rhel import exceptions, i18n
from convert2rhel.logger import root_logger
from convert2rhel.toolopts import tool_opts
from convert2rhel.toolopts.__init__ import tool_opts


logger = root_logger.getChild(__name__)
Expand Down
82 changes: 24 additions & 58 deletions man/convert2rhel.8
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.TH CONVERT2RHEL "1" "2024\-03\-04" "convert2rhel 1.7.1" "General Commands Manual"
.TH CONVERT2RHEL "1" "2024\-11\-24" "convert2rhel 2.1.0" "General Commands Manual"
.SH NAME
convert2rhel \- Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux.
.SH SYNOPSIS
.
convert2rhel [--version] [-h]
convert2rhel <subcommand> [-u username] [-p password | -c conf_file_path] [--pool pool_id | -a] [--disablerepo repoid] [--enablerepo repoid] [--serverurl url] [--no-rpm-va] [--els] [--eus] [--debug] [--restart] [-y]
convert2rhel <subcommand> [--no-rhsm] [--disablerepo repoid] [--enablerepo repoid] [--no-rpm-va] [--els] [--eus] [--debug] [--restart] [-y]
convert2rhel <subcommand> [--no-rhsm] [--disablerepo repoid] [--enablerepo repoid] [--no-rpm-va] [--els ] [--eus] [--debug] [--restart] [-y]
convert2rhel <subcommand> [-k activation_key | -c conf_file_path] [-o organization] [--pool pool_id | -a] [--disablerepo repoid] [--enablerepo repoid] [--serverurl url] [--no-rpm-va] [--els] [--eus] [--debug] [--restart] [-y]
.SH DESCRIPTION
The Convert2RHEL utility automates converting Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux. The whole conversion procedure is performed on the running RHEL derivative OS installation and a restart is needed at the end of the conversion to boot into the RHEL kernel. The utility replaces the original OS packages with the RHEL ones. Available are conversions of CentOS Linux 7/8, Oracle Linux 7/8, Scientific Linux 7, Alma Linux 8, and Rocky Linux 8 to the respective major version of RHEL.
Expand All @@ -32,9 +32,9 @@ Convert the system. If no subcommand is given, 'convert' is used as a default.
.SH COMMAND \fI\,'convert2rhel analyze'\/\fR
usage:
convert2rhel [\-\-version] [\-h]
convert2rhel analyze [\-u username] [\-p password | \-c conf_file_path] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-els] [\-\-eus] [\-\-debug] [\-\-restart] [\-y]
convert2rhel analyze [\-\-no\-rhsm] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-no\-rpm\-va] [\-\-els] [\-\-eus] [\-\-debug] [\-\-restart] [\-y]
convert2rhel analyze [\-k activation_key | \-c conf_file_path] [\-o organization] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-els] [\-\-eus] [\-\-debug] [\-\-restart] [\-y]
convert2rhel analyze [\-u username] [\-p password | \-c conf_file_path] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-eus] [\-\-els] [\-\-debug] [\-\-restart] [\-y]
convert2rhel analyze [\-\-no\-rhsm] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-no\-rpm\-va] [\-\-eus] [\-\-els] [\-\-debug] [\-\-restart] [\-y]
convert2rhel analyze [\-k activation_key | \-c conf_file_path] [\-o organization] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-eus] [\-\-els] [\-\-debug] [\-\-restart] [\-y]

.SH OPTIONS \fI\,'convert2rhel analyze'\/\fR
.TP
Expand All @@ -53,19 +53,17 @@ before and after the conversion with the output stored in log files rpm_va.log
and rpm_va_after_conversion.log. At the end of the conversion, these logs are
compared to show you what rpm files have been affected by the conversion.
Cannot be used with analyze subcommand. The environment variable
CONVERT2RHEL_INCOMPLETE_ROLLBACK needs to be set to 1 to use this
argument.
CONVERT2RHEL_INCOMPLETE_ROLLBACK needs to be set to 1 to use this argument.

.TP
\fB\-\-els\fR
Utilize Extended Lifecycle Support (els) repositories. Necessary for RHEL 7
servers to land on a system patched with the latest security errata.
\fB\-\-eus\fR
Explicitly recognize the system as eus, utilizing eus repos. This option is
meant for el8.8+ systems.

.TP
\fB\-\-eus\fR
Automatically recognize the system as eus, utilizing eus repos. 8.6 systems do
not require this option as they are recognized as eus automatically. This
option is meant for 8.8+ systems.
\fB\-\-els\fR
Explicitly recognize the system as els, utilizing els repos. This option is
meant for el7 systems.

.TP
\fB\-\-enablerepo\fR \fI\,repoidglob\/\fR
Expand Down Expand Up @@ -105,13 +103,7 @@ recommend using the \-\-config\-file option instead to prevent leaking the
password through a list of running processes.

.TP
\fB\-f\fR \fI\,PASSWORD_FROM_FILE\/\fR, \fB\-\-password\-from\-file\fR \fI\,PASSWORD_FROM_FILE\/\fR
File containing password for the subscription\-manager in the plain text form.
It's an alternative to the \-\-password option. Deprecated, use \-\-config\-file
instead.

.TP
\fB\-k\fR \fI\,ACTIVATIONKEY\/\fR, \fB\-\-activationkey\fR \fI\,ACTIVATIONKEY\/\fR
\fB\-k\fR \fI\,ACTIVATION_KEY\/\fR, \fB\-\-activationkey\fR \fI\,ACTIVATION_KEY\/\fR
Activation key used for the system registration by the subscription\-manager.
It requires to have the \-\-org option specified. We recommend using the
\-\-config\-file option instead to prevent leaking the activation key through a
Expand Down Expand Up @@ -154,18 +146,9 @@ Management service (subscription.rhsm.redhat.com). It is not to be used to
specify a Satellite server. For that, read the product documentation at
https://access.redhat.com/.

.TP
\fB\-\-keep\-rhsm\fR
Deprecated. This option has no effect. Convert2rhel will now use whatever
subscription\-manager packages are present on the system.

.SH ALTERNATIVE INSTALLATION OPTIONS \fI\,'convert2rhel analyze'\/\fR
The following options are required if you do not intend on using subscription\-manager.

.TP
\fB\-\-disable\-submgr\fR
Replaced by \-\-no\-rhsm. Both options have the same effect.

.TP
\fB\-\-no\-rhsm\fR
Do not use the subscription\-manager, use custom repositories instead. See
Expand All @@ -176,9 +159,9 @@ requires to have the \-\-enablerepo specified.
.SH COMMAND \fI\,'convert2rhel convert'\/\fR
usage:
convert2rhel [\-\-version] [\-h]
convert2rhel convert [\-u username] [\-p password | \-c conf_file_path] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-els] [\-\-eus] [\-\-debug] [\-\-restart] [\-y]
convert2rhel convert [\-\-no\-rhsm] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-no\-rpm\-va] [\-\-els] [\-\-eus] [\-\-debug] [\-\-restart] [\-y]
convert2rhel convert [\-k activation_key | \-c conf_file_path] [\-o organization] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-els] [\-\-eus] [\-\-debug] [\-\-restart] [\-y]
convert2rhel convert [\-u username] [\-p password | \-c conf_file_path] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-eus] [\-\-els] [\-\-debug] [\-\-restart] [\-y]
convert2rhel convert [\-\-no\-rhsm] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-no\-rpm\-va] [\-\-eus] [\-\-els] [\-\-debug] [\-\-restart] [\-y]
convert2rhel convert [\-k activation_key | \-c conf_file_path] [\-o organization] [\-\-pool pool_id | \-a] [\-\-disablerepo repoid] [\-\-enablerepo repoid] [\-\-serverurl url] [\-\-no\-rpm\-va] [\-\-eus] [\-\-els] [\-\-debug] [\-\-restart] [\-y]

.SH OPTIONS \fI\,'convert2rhel convert'\/\fR
.TP
Expand All @@ -197,19 +180,17 @@ before and after the conversion with the output stored in log files rpm_va.log
and rpm_va_after_conversion.log. At the end of the conversion, these logs are
compared to show you what rpm files have been affected by the conversion.
Cannot be used with analyze subcommand. The environment variable
CONVERT2RHEL_INCOMPLETE_ROLLBACK needs to be set to 1 to use this
argument.
CONVERT2RHEL_INCOMPLETE_ROLLBACK needs to be set to 1 to use this argument.

.TP
\fB\-\-els\fR
Utilize Extended Lifecycle Support (els) repositories. Necessary for RHEL 7
servers to land on a system patched with the latest security errata.
\fB\-\-eus\fR
Explicitly recognize the system as eus, utilizing eus repos. This option is
meant for el8.8+ systems.

.TP
\fB\-\-eus\fR
Automatically recognize the system as eus, utilizing eus repos. 8.6 systems do
not require this option as they are recognized as eus automatically. This
option is meant for 8.8+ systems.
\fB\-\-els\fR
Explicitly recognize the system as els, utilizing els repos. This option is
meant for el7 systems.

.TP
\fB\-\-enablerepo\fR \fI\,repoidglob\/\fR
Expand Down Expand Up @@ -249,13 +230,7 @@ recommend using the \-\-config\-file option instead to prevent leaking the
password through a list of running processes.

.TP
\fB\-f\fR \fI\,PASSWORD_FROM_FILE\/\fR, \fB\-\-password\-from\-file\fR \fI\,PASSWORD_FROM_FILE\/\fR
File containing password for the subscription\-manager in the plain text form.
It's an alternative to the \-\-password option. Deprecated, use \-\-config\-file
instead.

.TP
\fB\-k\fR \fI\,ACTIVATIONKEY\/\fR, \fB\-\-activationkey\fR \fI\,ACTIVATIONKEY\/\fR
\fB\-k\fR \fI\,ACTIVATION_KEY\/\fR, \fB\-\-activationkey\fR \fI\,ACTIVATION_KEY\/\fR
Activation key used for the system registration by the subscription\-manager.
It requires to have the \-\-org option specified. We recommend using the
\-\-config\-file option instead to prevent leaking the activation key through a
Expand Down Expand Up @@ -298,18 +273,9 @@ Management service (subscription.rhsm.redhat.com). It is not to be used to
specify a Satellite server. For that, read the product documentation at
https://access.redhat.com/.

.TP
\fB\-\-keep\-rhsm\fR
Deprecated. This option has no effect. Convert2rhel will now use whatever
subscription\-manager packages are present on the system.

.SH ALTERNATIVE INSTALLATION OPTIONS \fI\,'convert2rhel convert'\/\fR
The following options are required if you do not intend on using subscription\-manager.

.TP
\fB\-\-disable\-submgr\fR
Replaced by \-\-no\-rhsm. Both options have the same effect.

.TP
\fB\-\-no\-rhsm\fR
Do not use the subscription\-manager, use custom repositories instead. See
Expand Down
23 changes: 16 additions & 7 deletions scripts/manpage_generation.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not enough to check with the previous version. I would like to see the manpages generated and the difference checked to see if there are any changes. Not just if the version changed.

As this will fail every time we submit a new version it's already too late to update too.

Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
# Directory to store the generated manpages
MANPAGE_DIR="man"

echo Generating manpages
# Ensure the manpage directory exists
mkdir -p "$MANPAGE_DIR"
Comment on lines +6 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


VER=$(grep -oP '^Version:\s+\K\S+' packaging/convert2rhel.spec)
echo "Generating manpages"

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
python -c 'from convert2rhel import toolopts; print("[synopsis]\n."+toolopts.CLI.usage())' > "$MANPAGE_DIR/synopsis"

/usr/bin/python -m pip install argparse-manpage six pexpect
# Extract the current version from the spec file
CURRENT_VER=$(grep -oP '^Version:\s+\K\S+' packaging/convert2rhel.spec)
echo "Current version: $CURRENT_VER"

# 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"
PYTHONPATH=. 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 $CURRENT_VER" --prog="convert2rhel" --include man/distribution --include man/synopsis > "$MANPAGE_DIR/convert2rhel.8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing python call here. Does it still work locally?


git status
# Check for differences in the generated manpage
if ! git diff --quiet HEAD -- "$MANPAGE_DIR/convert2rhel.8"; then
echo "Manpages are outdated. Please update them."
exit 1
else
echo "Manpages are up-to-date."
exit 0
fi
Comment on lines +22 to +28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

Loading