[Python-checkins] r82272 - in python/trunk: Lib/distutils/unixccompiler.py setup.py

ronald.oussoren python-checkins at python.org
Sun Jun 27 14:36:16 CEST 2010


Author: ronald.oussoren
Date: Sun Jun 27 14:36:16 2010
New Revision: 82272

Log:
Two small fixes for the support for SDKs on MacOSX:

1) The code that checks if an path should be located in the SDK
   explicitly excludes /usr/local. This fixes issue9046

2) The SDK variant for filtering "db_dirs_to_check" in setup.py
   was not doing anything because of a missing assignment.


Modified:
   python/trunk/Lib/distutils/unixccompiler.py
   python/trunk/setup.py

Modified: python/trunk/Lib/distutils/unixccompiler.py
==============================================================================
--- python/trunk/Lib/distutils/unixccompiler.py	(original)
+++ python/trunk/Lib/distutils/unixccompiler.py	Sun Jun 27 14:36:16 2010
@@ -324,7 +324,9 @@
             static = os.path.join(dir, static_f)
 
             if sys.platform == 'darwin' and (
-                    dir.startswith('/System/') or dir.startswith('/usr/')):
+                dir.startswith('/System/') or (
+                dir.startswith('/usr/') and not dir.startswith('/usr/local/'))):
+
                 shared = os.path.join(sysroot, dir[1:], shared_f)
                 dylib = os.path.join(sysroot, dir[1:], dylib_f)
                 static = os.path.join(sysroot, dir[1:], static_f)

Modified: python/trunk/setup.py
==============================================================================
--- python/trunk/setup.py	(original)
+++ python/trunk/setup.py	Sun Jun 27 14:36:16 2010
@@ -47,7 +47,7 @@
     """
     Returns True if 'path' can be located in an OSX SDK
     """
-    return path.startswith('/usr/') or path.startswith('/System/')
+    return (path.startswith('/usr/') and not path.startswith('/usr/local')) or path.startswith('/System/')
 
 def find_file(filename, std_dirs, paths):
     """Searches for the directory where a given file is located,
@@ -922,6 +922,7 @@
                         else:
                             if os.path.isdir(dn):
                                 tmp.append(dn)
+                    db_dirs_to_check = tmp
 
                 # Look for a version specific db-X.Y before an ambiguoius dbX
                 # XXX should we -ever- look for a dbX name?  Do any


More information about the Python-checkins mailing list