8000 Fix generated file name for installer builds on macOS 11+. (GH-25661) · python/cpython@8a37463 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a37463

Browse files
authored
Fix generated file name for installer builds on macOS 11+. (GH-25661)
1 parent ce82781 commit 8a37463

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

Mac/BuildScript/build-installer.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,13 +1615,35 @@ def buildDMG():
16151615
# installer file name. With the introduction of weaklinked installer
16161616
# variants, we may have two variants with the same file name, i.e.
16171617
# both ending in '10.9'. To avoid this, we now use the major/minor
1618-
# version numbers of the macOS version we are building on, i.e.
1619-
# '10.9' as before for 10.9+ variant, '11.0' for universal2 11.0-.
1620-
# it's not ideal but should cause the least disruption to packaging
1621-
# workflows.
1622-
build_system_version = '.'.join(platform.mac_ver()[0].split('.')[0:2])
1618+
# version numbers of the macOS version we are building on.
1619+
# Also, as of macOS 11, operating system version numbering has
1620+
# changed from three components to two, i.e.
1621+
# 10.14.1, 10.14.2, ...
1622+
# 10.15.1, 10.15.2, ...
1623+
# 11.1, 11.2, ...
1624+
# 12.1, 12.2, ...
1625+
# (A further twist is that, when running on macOS 11, binaries built
1626+
# on older systems may be shown an operating system version of 10.16
1627+
# instead of 11. We should not run into that situation here.)
1628+
# Also we should use "macos" instead of "macosx" going forward.
1629+
#
1630+
# To maintain compability for legacy variants, the file name for
1631+
# builds on macOS 10.15 and earlier remains:
1632+
# python-3.x.y-macosx10.z.{dmg->pkg}
1633+
# e.g. python-3.9.4-macosx10.9.{dmg->pkg}
1634+
# and for builds on macOS 11+:
1635+
# python-3.x.y-macosz.{dmg->pkg}
1636+
# e.g. python-3.9.4-macos11.{dmg->pkg}
1637+
1638+
build_tuple = getBuildTuple()
1639+
if build_tuple[0] < 11:
1640+
os_name = 'macosx'
1641+
build_system_version = '%s.%s' % build_tuple
1642+
else:
1643+
os_name = 'macos'
1644+
build_system_version = str(build_tuple[0])
16231645
imagepath = os.path.join(outdir,
1624-
'python-%s-macosx%s'%(getFullVersion(),build_system_version))
1646+
'python-%s-%s%s'%(getFullVersion(),os_name,build_system_version))
16251647
if INCLUDE_TIMESTAMP:
16261648
imagepath = imagepath + '-%04d-%02d-%02d'%(time.localtime()[:3])
16271649
imagepath = imagepath + '.dmg'

0 commit comments

Comments
 (0)
0