Skip to content

Commit

Permalink
doc: allow missing components when genrating manapages
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonOdiwuor committed Nov 12, 2024
1 parent 55b50c8 commit 59cee70
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions contrib/devtools/gen-manpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
import tempfile
import configparser
import argparse

BINARIES = [
'build/src/bitcoind',
Expand All @@ -17,6 +18,14 @@
'build/src/qt/bitcoin-qt',
]

parser = argparse.ArgumentParser()
parser.add_argument(
'--allow-missing-components',
action='store_true',
help='Allow missing components when generating manpages',
)
args = parser.parse_args()

# Paths to external utilities.
git = os.getenv('GIT', 'git')
help2man = os.getenv('HELP2MAN', 'help2man')
Expand Down Expand Up @@ -81,14 +90,15 @@
'ENABLE_USDT_TRACEPOINTS': 'USDT tracepoints',
}

for component, description in (required_components | enabled_components).items():
if not config['components'].getboolean(component, fallback=False):
print(
"Aborting generating manpages...\n"
f"Error: '{component}' ({description}) support is not enabled.\n"
"Please enable it and try again."
)
sys.exit(1)
if not args.allow_missing_components:
for component, description in (required_components | enabled_components).items():
if not config['components'].getboolean(component, fallback=False):
print(
"Aborting generating manpages...\n"
f"Error: '{component}' ({description}) support is not enabled.\n"
"Please enable it and try again."
)
sys.exit(1)

for component in config['components']:
if component.upper() not in required_components and component.upper() not in enabled_components:
Expand Down

0 comments on commit 59cee70

Please sign in to comment.