]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sphinx: simplify default in baseconf.py.
authorMartin Liska <mliska@suse.cz>
Wed, 9 Nov 2022 10:51:34 +0000 (11:51 +0100)
committerMartin Liska <mliska@suse.cz>
Wed, 9 Nov 2022 10:52:13 +0000 (11:52 +0100)
ChangeLog:

* doc/baseconf.py: Simplify BUGURL and VERSION_PACKAGE,
provide a default.

maintainer-scripts/ChangeLog:

* update_web_docs_git.py: Simplify.

doc/baseconf.py
maintainer-scripts/update_web_docs_git.py

index f80fdabc8b0e8782314f401c776d0be5752ff6ce..47e3a1264165f89067c3135c8437b800b97bca1a 100644 (file)
@@ -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)
index f3f59953ac0bb2ff9845bfd8a30b94cd79fa3b81..18c8bbb8324b381d612935070a7bfa27fbf4f79e 100755 (executable)
@@ -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')