aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-09-25 05:09:29 -0400
committerJack Lloyd <[email protected]>2020-09-25 07:34:30 -0400
commit8822fd3902d3bb770483deac9eb4bd13cac33b42 (patch)
treeb9082f5976c62da7b1577e0640dc02144fa04cc5 /configure.py
parentd317d8f00baef362609f80b4bad3e63582acfe83 (diff)
Support suffixes on version numbers
This extends the versioning from just an integer trip to also support a suffix of the form -{alpha,beta,rc}N Also fix a problem with reproducible releases caused by Python tarfile switching its default format from GNU to PAX. Use PAX for the releases that were (unintentionally) released as PAX and GNU for everything else.
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/configure.py b/configure.py
index 9c7d517e9..a8ab62536 100755
--- a/configure.py
+++ b/configure.py
@@ -90,6 +90,13 @@ class Version(object):
if not Version.data:
root_dir = os.path.dirname(os.path.realpath(__file__))
Version.data = parse_version_file(os.path.join(root_dir, 'src/build-data/version.txt'))
+
+ suffix = Version.data["release_suffix"]
+ if suffix != "":
+ suffix_re = re.compile('-(alpha|beta|rc)[0-9]+')
+
+ if not suffix_re.match(suffix):
+ raise Exception("Unexpected version suffix '%s'" % (suffix))
return Version.data
@staticmethod
@@ -105,6 +112,10 @@ class Version(object):
return Version.get_data()["release_patch"]
@staticmethod
+ def suffix():
+ return Version.get_data()["release_suffix"]
+
+ @staticmethod
def packed():
# Used on macOS for dylib versioning
return Version.major() * 1000 + Version.minor()
@@ -123,7 +134,7 @@ class Version(object):
@staticmethod
def as_string():
- return '%d.%d.%d' % (Version.major(), Version.minor(), Version.patch())
+ return '%d.%d.%d%s' % (Version.major(), Version.minor(), Version.patch(), Version.suffix())
@staticmethod
def vc_rev():
@@ -1981,6 +1992,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch,
'version_major': Version.major(),
'version_minor': Version.minor(),
'version_patch': Version.patch(),
+ 'version_suffix': Version.suffix(),
'version_vc_rev': 'unknown' if options.no_store_vc_rev else Version.vc_rev(),
'abi_rev': Version.so_rev(),