From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 51C243858C62; Wed, 9 Nov 2022 10:52:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51C243858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667991162; bh=UHZ7hM7GuwKj0CY2nK8iqQebsgOSXEqNlcO/hQRF4xE=; h=From:To:Subject:Date:From; b=Dw7O9C50xXNmhOSoIFNawSgjcLqM/SP4FjpHYc2ScQTj05ItVyNKjAvcae3ppKTBX F2HmR4ZwQfd6JNC8+ns5nNi+7mZ4XOyjG7D3mQDclhv1QZ9N93kPXg3RejDWRGMO8Z 2DwC5rIWYmrpHQHVSPtC4KoQQ/6nm7UOYal19mTI= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3849] sphinx: simplify default in baseconf.py. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: 05119c345797bc04cc34e6973ebd921b4dcb0326 X-Git-Newrev: 8d7a55b7f4ce37ecc869bd31cadc3f9e059e2f44 Message-Id: <20221109105242.51C243858C62@sourceware.org> Date: Wed, 9 Nov 2022 10:52:42 +0000 (GMT) List-Id: https://gcc.gnu.org/g:8d7a55b7f4ce37ecc869bd31cadc3f9e059e2f44 commit r13-3849-g8d7a55b7f4ce37ecc869bd31cadc3f9e059e2f44 Author: Martin Liska Date: Wed Nov 9 11:51:34 2022 +0100 sphinx: simplify default in baseconf.py. ChangeLog: * doc/baseconf.py: Simplify BUGURL and VERSION_PACKAGE, provide a default. maintainer-scripts/ChangeLog: * update_web_docs_git.py: Simplify. Diff: --- doc/baseconf.py | 13 ++++++------- maintainer-scripts/update_web_docs_git.py | 9 ++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/doc/baseconf.py b/doc/baseconf.py index f80fdabc8b0..47e3a126416 100644 --- a/doc/baseconf.py +++ b/doc/baseconf.py @@ -71,13 +71,11 @@ needs_sphinx = '5.3' rst_epilog = ''' .. |gcc_version| replace:: %s .. |needs_sphinx| replace:: %s\n -''' % (gcc_BASEVER, needs_sphinx) - -if BUGURL: - rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL - -if VERSION_PACKAGE: - rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE +.. |bugurl| replace:: %s\n +.. |package_version| replace:: %s\n +''' % (gcc_BASEVER, needs_sphinx, + BUGURL if BUGURL else 'https://gcc.gnu.org/bugs/', + VERSION_PACKAGE if VERSION_PACKAGE else '(GCC)') # -- General configuration --------------------------------------------------- @@ -206,6 +204,7 @@ extlinks = { extlinks_detect_hardcoded_links = True + # Set common settings where we need NAME of the documentation def set_common(name, module): module['tags'].add(name) diff --git a/maintainer-scripts/update_web_docs_git.py b/maintainer-scripts/update_web_docs_git.py index f3f59953ac0..18c8bbb8324 100755 --- a/maintainer-scripts/update_web_docs_git.py +++ b/maintainer-scripts/update_web_docs_git.py @@ -10,7 +10,6 @@ import tempfile from pathlib import Path GITROOT = '/git/gcc.git' -BUGURL = 'https://gcc.gnu.org/bugs/' parser = argparse.ArgumentParser(description='Update web documentation.') parser.add_argument('output_folder', help='Output folder') @@ -53,10 +52,6 @@ with tempfile.TemporaryDirectory() as folder: temp = Path('tmp').resolve() temp.mkdir() - # Prepare default env. variables - childenv = os.environ.copy() - childenv['BUGURL'] = BUGURL - # Build and copy the documentation for i, (config_folder, docname) in enumerate(sorted(configs)): print(f'=== building {i + 1}/{len(configs)}: {docname} ===') @@ -65,7 +60,7 @@ with tempfile.TemporaryDirectory() as folder: cmd = f'make -C doc html SOURCEDIR={config_folder} BUILDDIR={temp}/{docname}' if args.sphinx_build: cmd += f' SPHINXBUILD={args.sphinx_build}' - subprocess.run(cmd, shell=True, env=childenv, check=True, + subprocess.run(cmd, shell=True, check=True, capture_output=not args.verbose) os.unlink(f'{temp}/{docname}/html/.buildinfo') shutil.copytree(f'{temp}/{docname}/html', f'{output}/{docname}', @@ -75,7 +70,7 @@ with tempfile.TemporaryDirectory() as folder: cmd = f'make -C doc latexpdf SOURCEDIR={config_folder} BUILDDIR={temp}/pdf/{docname}' if args.sphinx_build: cmd += f' SPHINXBUILD={args.sphinx_build}' - subprocess.run(cmd, shell=True, env=childenv, check=True, + subprocess.run(cmd, shell=True, check=True, capture_output=not args.verbose) shutil.copyfile(f'{temp}/pdf/{docname}/latex/{docname}.pdf', f'{output}/{docname}.pdf')