public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/sphinx-v2)] baseconf: make bugurl optional
@ 2021-06-25 8:05 Martin Liska
0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2021-06-25 8:05 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:569de749f4ce494259d21ad83e7185b21631dc67
commit 569de749f4ce494259d21ad83e7185b21631dc67
Author: Martin Liska <mliska@suse.cz>
Date: Fri Jun 25 09:55:04 2021 +0200
baseconf: make bugurl optional
Diff:
---
doc/baseconf.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/doc/baseconf.py b/doc/baseconf.py
index c50dcc57299..f56cca0577f 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -22,6 +22,7 @@ import os
folder = os.path.dirname(os.path.realpath(__file__))
gcc_srcdir = os.path.join(folder, '..', 'gcc')
+
def __read_file(name):
path = os.path.join(gcc_srcdir, name)
if os.path.exists(path):
@@ -29,6 +30,7 @@ def __read_file(name):
else:
return ''
+
gcc_BASEVER = __read_file('BASE-VER')
gcc_DEVPHASE = __read_file('DEV-PHASE')
gcc_DATESTAMP = __read_file('DATESTAMP')
@@ -36,7 +38,7 @@ gcc_REVISION = __read_file('REVISION')
VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
BUGURL = os.getenv('BUGURL')
-assert VERSION_PACKAGE is not None and BUGURL is not None
+assert VERSION_PACKAGE is not None
# The short X.Y version.
version = gcc_BASEVER
@@ -46,11 +48,13 @@ release = ('%s (%s %s%s)'
% (gcc_BASEVER, gcc_DEVPHASE, gcc_DATESTAMP,
(' %s' % gcc_REVISION) if gcc_REVISION else ''))
-rst_epilog = '''
+rst_epilog = """
.. |gcc_version| replace:: %s
.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL)
+""" % (gcc_BASEVER, VERSION_PACKAGE)
+
+if BUGURL:
+ rst_epilog += '.. |bugurl| replace:: %s' % BUGURL
# -- General configuration ---------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc(refs/users/marxin/heads/sphinx-v2)] baseconf: make bugurl optional
@ 2021-06-25 7:55 Martin Liska
0 siblings, 0 replies; 2+ messages in thread
From: Martin Liska @ 2021-06-25 7:55 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2beca6cbe2e3600b8a1bf5c9192090f5500ce2d3
commit 2beca6cbe2e3600b8a1bf5c9192090f5500ce2d3
Author: Martin Liska <mliska@suse.cz>
Date: Fri Jun 25 09:55:04 2021 +0200
baseconf: make bugurl optional
Diff:
---
doc/baseconf.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/doc/baseconf.py b/doc/baseconf.py
index c50dcc57299..a80292cded8 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -22,6 +22,7 @@ import os
folder = os.path.dirname(os.path.realpath(__file__))
gcc_srcdir = os.path.join(folder, '..', 'gcc')
+
def __read_file(name):
path = os.path.join(gcc_srcdir, name)
if os.path.exists(path):
@@ -29,6 +30,7 @@ def __read_file(name):
else:
return ''
+
gcc_BASEVER = __read_file('BASE-VER')
gcc_DEVPHASE = __read_file('DEV-PHASE')
gcc_DATESTAMP = __read_file('DATESTAMP')
@@ -36,7 +38,7 @@ gcc_REVISION = __read_file('REVISION')
VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
BUGURL = os.getenv('BUGURL')
-assert VERSION_PACKAGE is not None and BUGURL is not None
+assert VERSION_PACKAGE
# The short X.Y version.
version = gcc_BASEVER
@@ -46,11 +48,15 @@ release = ('%s (%s %s%s)'
% (gcc_BASEVER, gcc_DEVPHASE, gcc_DATESTAMP,
(' %s' % gcc_REVISION) if gcc_REVISION else ''))
-rst_epilog = '''
+rst_epilog = """
.. |gcc_version| replace:: %s
.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL)
+""" % (gcc_BASEVER, VERSION_PACKAGE)
+
+if BUGURL:
+ rst_epilog += '.. |bugurl| replace:: %s' % BUGURL
+
+print(rst_epilog)
# -- General configuration ---------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-25 8:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 8:05 [gcc(refs/users/marxin/heads/sphinx-v2)] baseconf: make bugurl optional Martin Liska
-- strict thread matches above, loose matches on Subject: below --
2021-06-25 7:55 Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).