Revert "sphinx: simplify default in baseconf.py."
This reverts commit 8d7a55b7f4
.
This commit is contained in:
parent
8c7311c198
commit
705dd990de
2 changed files with 14 additions and 8 deletions
|
@ -71,11 +71,13 @@ needs_sphinx = '5.3'
|
||||||
rst_epilog = '''
|
rst_epilog = '''
|
||||||
.. |gcc_version| replace:: %s
|
.. |gcc_version| replace:: %s
|
||||||
.. |needs_sphinx| replace:: %s\n
|
.. |needs_sphinx| replace:: %s\n
|
||||||
.. |bugurl| replace:: %s\n
|
''' % (gcc_BASEVER, needs_sphinx)
|
||||||
.. |package_version| replace:: %s\n
|
|
||||||
''' % (gcc_BASEVER, needs_sphinx,
|
if BUGURL:
|
||||||
BUGURL if BUGURL else 'https://gcc.gnu.org/bugs/',
|
rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
|
||||||
VERSION_PACKAGE if VERSION_PACKAGE else '(GCC)')
|
|
||||||
|
if VERSION_PACKAGE:
|
||||||
|
rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
||||||
|
@ -204,7 +206,6 @@ extlinks = {
|
||||||
|
|
||||||
extlinks_detect_hardcoded_links = True
|
extlinks_detect_hardcoded_links = True
|
||||||
|
|
||||||
|
|
||||||
# Set common settings where we need NAME of the documentation
|
# Set common settings where we need NAME of the documentation
|
||||||
def set_common(name, module):
|
def set_common(name, module):
|
||||||
module['tags'].add(name)
|
module['tags'].add(name)
|
||||||
|
|
|
@ -10,6 +10,7 @@ import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
GITROOT = '/git/gcc.git'
|
GITROOT = '/git/gcc.git'
|
||||||
|
BUGURL = 'https://gcc.gnu.org/bugs/'
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Update web documentation.')
|
parser = argparse.ArgumentParser(description='Update web documentation.')
|
||||||
parser.add_argument('output_folder', help='Output folder')
|
parser.add_argument('output_folder', help='Output folder')
|
||||||
|
@ -52,6 +53,10 @@ with tempfile.TemporaryDirectory() as folder:
|
||||||
temp = Path('tmp').resolve()
|
temp = Path('tmp').resolve()
|
||||||
temp.mkdir()
|
temp.mkdir()
|
||||||
|
|
||||||
|
# Prepare default env. variables
|
||||||
|
childenv = os.environ.copy()
|
||||||
|
childenv['BUGURL'] = BUGURL
|
||||||
|
|
||||||
# Build and copy the documentation
|
# Build and copy the documentation
|
||||||
for i, (config_folder, docname) in enumerate(sorted(configs)):
|
for i, (config_folder, docname) in enumerate(sorted(configs)):
|
||||||
print(f'=== building {i + 1}/{len(configs)}: {docname} ===')
|
print(f'=== building {i + 1}/{len(configs)}: {docname} ===')
|
||||||
|
@ -60,7 +65,7 @@ with tempfile.TemporaryDirectory() as folder:
|
||||||
cmd = f'make -C doc html SOURCEDIR={config_folder} BUILDDIR={temp}/{docname}'
|
cmd = f'make -C doc html SOURCEDIR={config_folder} BUILDDIR={temp}/{docname}'
|
||||||
if args.sphinx_build:
|
if args.sphinx_build:
|
||||||
cmd += f' SPHINXBUILD={args.sphinx_build}'
|
cmd += f' SPHINXBUILD={args.sphinx_build}'
|
||||||
subprocess.run(cmd, shell=True, check=True,
|
subprocess.run(cmd, shell=True, env=childenv, check=True,
|
||||||
capture_output=not args.verbose)
|
capture_output=not args.verbose)
|
||||||
os.unlink(f'{temp}/{docname}/html/.buildinfo')
|
os.unlink(f'{temp}/{docname}/html/.buildinfo')
|
||||||
shutil.copytree(f'{temp}/{docname}/html', f'{output}/{docname}',
|
shutil.copytree(f'{temp}/{docname}/html', f'{output}/{docname}',
|
||||||
|
@ -70,7 +75,7 @@ with tempfile.TemporaryDirectory() as folder:
|
||||||
cmd = f'make -C doc latexpdf SOURCEDIR={config_folder} BUILDDIR={temp}/pdf/{docname}'
|
cmd = f'make -C doc latexpdf SOURCEDIR={config_folder} BUILDDIR={temp}/pdf/{docname}'
|
||||||
if args.sphinx_build:
|
if args.sphinx_build:
|
||||||
cmd += f' SPHINXBUILD={args.sphinx_build}'
|
cmd += f' SPHINXBUILD={args.sphinx_build}'
|
||||||
subprocess.run(cmd, shell=True, check=True,
|
subprocess.run(cmd, shell=True, env=childenv, check=True,
|
||||||
capture_output=not args.verbose)
|
capture_output=not args.verbose)
|
||||||
shutil.copyfile(f'{temp}/pdf/{docname}/latex/{docname}.pdf',
|
shutil.copyfile(f'{temp}/pdf/{docname}/latex/{docname}.pdf',
|
||||||
f'{output}/{docname}.pdf')
|
f'{output}/{docname}.pdf')
|
||||||
|
|
Loading…
Add table
Reference in a new issue