summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorNed Deily <nad@python.org>2021-04-27 17:23:39 (GMT)
committerGitHub <noreply@github.com>2021-04-27 17:23:39 (GMT)
commit8a37463989410a79f6d1131d08dc0165bcaa0f9d (patch)
tree9fe5634046291963252912e31fefc76f78269398 /Mac
parentce827816442613f982c356aa2f434c3c8a0c8917 (diff)
downloadcpython-8a37463989410a79f6d1131d08dc0165bcaa0f9d.zip
cpython-8a37463989410a79f6d1131d08dc0165bcaa0f9d.tar.gz
cpython-8a37463989410a79f6d1131d08dc0165bcaa0f9d.tar.bz2
Fix generated file name for installer builds on macOS 11+. (GH-25661)
Diffstat (limited to 'Mac')
-rwxr-xr-xMac/BuildScript/build-installer.py34
1 files changed, 28 insertions, 6 deletions
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index d7f4103..b07def1 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -1615,13 +1615,35 @@ def buildDMG():
# installer file name. With the introduction of weaklinked installer
# variants, we may have two variants with the same file name, i.e.
# both ending in '10.9'. To avoid this, we now use the major/minor
- # version numbers of the macOS version we are building on, i.e.
- # '10.9' as before for 10.9+ variant, '11.0' for universal2 11.0-.
- # it's not ideal but should cause the least disruption to packaging
- # workflows.
- build_system_version = '.'.join(platform.mac_ver()[0].split('.')[0:2])
+ # version numbers of the macOS version we are building on.
+ # Also, as of macOS 11, operating system version numbering has
+ # changed from three components to two, i.e.
+ # 10.14.1, 10.14.2, ...
+ # 10.15.1, 10.15.2, ...
+ # 11.1, 11.2, ...
+ # 12.1, 12.2, ...
+ # (A further twist is that, when running on macOS 11, binaries built
+ # on older systems may be shown an operating system version of 10.16
+ # instead of 11. We should not run into that situation here.)
+ # Also we should use "macos" instead of "macosx" going forward.
+ #
+ # To maintain compability for legacy variants, the file name for
+ # builds on macOS 10.15 and earlier remains:
+ # python-3.x.y-macosx10.z.{dmg->pkg}
+ # e.g. python-3.9.4-macosx10.9.{dmg->pkg}
+ # and for builds on macOS 11+:
+ # python-3.x.y-macosz.{dmg->pkg}
+ # e.g. python-3.9.4-macos11.{dmg->pkg}
+
+ build_tuple = getBuildTuple()
+ if build_tuple[0] < 11:
+ os_name = 'macosx'
+ build_system_version = '%s.%s' % build_tuple
+ else:
+ os_name = 'macos'
+ build_system_version = str(build_tuple[0])
imagepath = os.path.join(outdir,
- 'python-%s-macosx%s'%(getFullVersion(),build_system_version))
+ 'python-%s-%s%s'%(getFullVersion(),os_name,build_system_version))
if INCLUDE_TIMESTAMP:
imagepath = imagepath + '-%04d-%02d-%02d'%(time.localtime()[:3])
imagepath = imagepath + '.dmg'