[Reproducible-builds] [dh-python] 21/183: split stats['ext'] into ext_vers and ext_no_version

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Sep 19 15:30:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dh-python.

commit bf0b5c905bd3d0b4a2c25d040e6dc35e9d6db23c
Author: Piotr Ożarowski <piotr at debian.org>
Date:   Mon Jul 1 22:42:13 2013 +0200

    split stats['ext'] into ext_vers and ext_no_version
    
    stats['ext'] contained False if extension version couldn't be detected,
    now paths to such extensions are stored in ext_no_version and ext_vers
    will contain Versions only (no need to filter this set anymore)
---
 dh_python2          | 11 ++++++-----
 dh_python3          | 13 +++++++------
 dhpython/depends.py | 15 ++++++++++-----
 3 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/dh_python2 b/dh_python2
index acd3981..83af4cd 100755
--- a/dh_python2
+++ b/dh_python2
@@ -74,7 +74,7 @@ def share(package, stats, options):
         # TODO: remove this once file conflicts will not be needed anymore
         move_to_pyshared(interpreter.sitedir(package, pubvers[0]))
 
-    for version in stats['ext']:
+    for version in stats['ext_vers']:
         create_ext_links(interpreter.sitedir(package, version))
 
     if options.guess_versions and pubvers:
@@ -83,7 +83,7 @@ def share(package, stats, options):
                 interpreter.version = version
                 log.debug('guessing files for %s', interpreter)
                 versions_without_ext = sorted(set(pubvers) -
-                                              stats['ext'])
+                                              stats['ext_vers'])
                 if not versions_without_ext:
                     log.error('extension for python%s is missing. '
                               'Build extensions for all supported Python '
@@ -644,8 +644,9 @@ def main():
 
             args = pdir
 
-            ext_for = details.get('ext')
-            if ext_for is None:  # no extension
+            ext_for = details.get('ext_vers')
+            ext_no_version = details.get('ext_no_version')
+            if ext_for is None and not ext_no_version:  # no extension
                 shebang_versions = list(i.version for i in details.get('shebangs', [])
                                         if i.version and i.version.minor)
                 if not options.ignore_shebangs and len(shebang_versions) == 1:
@@ -653,7 +654,7 @@ def main():
                     args += " -V %s" % shebang_versions[0]
                 elif options.vrange and options.vrange != (None, None):
                     args += " -V %s" % options.vrange
-            elif False in ext_for:
+            elif ext_no_version:
                 # at least one extension's version not detected
                 if options.vrange and '-' not in str(options.vrange):
                     ver = str(options.vrange)
diff --git a/dh_python3 b/dh_python3
index e223b45..0c829c6 100755
--- a/dh_python3
+++ b/dh_python3
@@ -354,14 +354,14 @@ def main():
         dependencies = Dependencies(package, 'cpython3')
         dependencies.parse(stats, options)
 
-        if stats['ext']:
+        if stats['ext_vers']:
             dh.addsubstvar(package, 'python3:Versions',
-                           ', '.join(str(v) for v in sorted(stats['ext'])))
+                           ', '.join(str(v) for v in sorted(stats['ext_vers'])))
             ps = package.split('-', 1)
             if len(ps) > 1 and ps[0] == 'python3':
                 dh.addsubstvar(package, 'python3:Provides',
                                ', '.join("python%s-%s" % (i, ps[1])
-                               for i in sorted(stats['ext'])))
+                               for i in sorted(stats['ext_vers'])))
 
         pyclean_added = False  # invoke pyclean only once in maintainer script
         if stats['compile']:
@@ -380,8 +380,9 @@ def main():
 
             args = pdir
 
-            ext_for = details.get('ext')
-            if ext_for is None:  # no extension
+            ext_for = details.get('ext_vers')
+            ext_no_version = details.get('ext_no_version')
+            if ext_for is None and not ext_no_version:  # no extension
                 shebang_versions = list(i.version for i in details.get('shebangs', [])
                                         if i.version and i.version.minor)
                 if not options.ignore_shebangs and len(shebang_versions) == 1:
@@ -389,7 +390,7 @@ def main():
                     args += " -V %s" % shebang_versions[0]
                 elif options.vrange and options.vrange != (None, None):
                     args += " -V %s" % options.vrange
-            elif False in ext_for:
+            elif ext_no_version:
                 # at least one extension's version not detected
                 if options.vrange and '-' not in str(options.vrange):
                     ver = str(options.vrange)
diff --git a/dhpython/depends.py b/dhpython/depends.py
index ce48504..4d64454 100644
--- a/dhpython/depends.py
+++ b/dhpython/depends.py
@@ -118,12 +118,12 @@ class Dependencies:
             if maxv >= default(self.impl):
                 self.depend("%s (<< %s)" % (tpl, maxv + 1))
 
-        if stats['ext']:
+        if stats['ext_vers']:
             # TODO: what about extensions with stable ABI?
-            sorted_vers = sorted(stats['ext'])
+            sorted_vers = sorted(stats['ext_vers'])
             minv = sorted_vers[0]
             maxv = sorted_vers[-1]
-            #self.depend('|'.join(vtpl % i for i in stats['ext']))
+            #self.depend('|'.join(vtpl % i for i in stats['ext_vers']))
             if minv <= default(self.impl):
                 self.depend("%s (>= %s)" % (tpl, minv))
             if maxv >= default(self.impl):
@@ -154,8 +154,8 @@ class Dependencies:
                 if self.impl in MINPYCDEP:
                     self.depend(MINPYCDEP[self.impl])
                 args = ''
-                if details.get('ext'):
-                    extensions = sorted(v for v in details['ext'] if v is not False)
+                if details.get('ext_vers'):
+                    extensions = sorted(details['ext_vers'])
                     #self.depend('|'.join(vtpl % i for i in extensions))
                     if extensions:
                         args += "-V %s" % VersionRange(minver=extensions[0], maxver=extensions[-1])
@@ -168,6 +168,11 @@ class Dependencies:
                     #if versions[0] in supported_versions:
                     args += "-V %s" % versions[0]
                     # ... otherwise compile with default version
+                elif details.get('ext_no_version'):
+                    # assume unrecognized extension was built for default interpreter version
+                    dversion = default(self.impl)
+                    args += "-V %s" % dversion
+                    self.depend(vtpl % dversion)
                 elif vrange:
                     args += "-V %s" % vrange
                     if vrange.minver == vrange.maxver:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dh-python.git



More information about the Reproducible-builds mailing list