diff options
| author | PJ Eby <distutils-sig@python.org> | 2005-07-21 04:50:50 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2005-07-21 04:50:50 +0000 |
| commit | dce75aeae87e88e11ca54d5354e3af8216c39e89 (patch) | |
| tree | 6a18ce46ed11c785d8a2e2e97921ceffff63252a /pkg_resources.py | |
| parent | 92cd79e46cb454878df36258c3731d0cf771ab55 (diff) | |
| download | python-setuptools-git-dce75aeae87e88e11ca54d5354e3af8216c39e89.tar.gz | |
Tweak Mac OS platform string based on Mac SIG feedback: remove "micro"
version number, and map "PowerPC" and "Power_Macintosh" to "ppc".
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041142
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 509465ea..f9d6e1ac 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -103,8 +103,11 @@ def get_platform(): try: version = _macosx_vers() machine = os.uname()[4].replace(" ", "_") - return "macosx-%d.%d.%d-%s" % (int(version[0]), int(version[1]), - int(version[2]), machine) + machine = { + 'PowerPC':'ppc', 'Power_Macintosh':'ppc' + }.get(machine,machine) + return "macosx-%d.%d-%s" % (int(version[0]), int(version[1]), + machine) except ValueError: # if someone is running a non-Mac darwin system, this will fall # through to the default implementation @@ -113,14 +116,11 @@ def get_platform(): from distutils.util import get_platform return get_platform() -macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)\.(\d+)-(.*)") +macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)-(.*)") # XXX darwinVersionString = re.compile(r"darwin-(\d+)\.(\d+)\.(\d+)-(.*)") - - - def compatible_platforms(provided,required): """Can code for the `provided` platform run on the `required` platform? @@ -143,7 +143,7 @@ def compatible_platforms(provided,required): # are they the same major version and machine type? if provMac.group(1) != reqMac.group(1) or \ - provMac.group(4) != reqMac.group(4): + provMac.group(3) != reqMac.group(3): return False # is the required OS major update >= the provided one? |
