]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
bundled zetuptoolz: choose a binary dist in preference to a source dist, even if...
authorZooko O'Whielacronx <zooko@zooko.com>
Wed, 17 Nov 2010 08:08:28 +0000 (00:08 -0800)
committerZooko O'Whielacronx <zooko@zooko.com>
Wed, 17 Nov 2010 08:08:28 +0000 (00:08 -0800)
patch by David-Sarah, tiny bugfix to patch by Zooko
ref: #1233

setuptools-0.6c16dev2.egg/setuptools/package_index.py

index 32498d0fd4c58adf7b89485d5453ee0cca5947b3..1cfdccc52175eb74474606b5d8be39e105cc747a 100644 (file)
@@ -436,18 +436,18 @@ class PackageIndex(Environment):
         def find(env, req):
             # Find a matching distribution; may be called more than once
 
-            for dist in env[req.key]:
-
-                if dist.precedence==DEVELOP_DIST and not develop_ok:
-                    if dist not in skipped:
-                        self.warn("Skipping development or system egg: %s",dist)
-                        skipped[dist] = 1
-                    continue
-
-                if dist in req and (dist.precedence<=SOURCE_DIST or not source):
-                    return dist
-
-
+            # first try to find a platform-dependent dist
+            for allow_platform_independent in (False, True):
+                for dist in env[req.key]:
+                    if dist.precedence==DEVELOP_DIST and not develop_ok:
+                        if dist not in skipped:
+                            self.warn("Skipping development or system egg: %s",dist)
+                            skipped[dist] = 1
+                        continue
+
+                    if (dist in req and (allow_platform_independent or dist.platform is not None) and
+                        (dist.precedence<=SOURCE_DIST or not source)):
+                        return dist
 
         if force_scan:
             self.prescan()