[Reproducible-builds] [dh-python] 110/183: generate interpreter dependencies for private dirs with extensions and without modules
Jérémy Bobbio
lunar at moszumanska.debian.org
Fri Sep 19 15:30:26 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 5ac90accd7806be7235cb536a914cd84d9446379
Author: Piotr Ożarowski <piotr at debian.org>
Date: Sun Sep 1 20:38:53 2013 +0200
generate interpreter dependencies for private dirs with extensions and without modules
---
debian/changelog | 3 +++
dhpython/depends.py | 27 ++++++++++++++-------------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index cea29e6..5077e74 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,9 @@ dh-python (1.20130830-1) UNRELEASED; urgency=low
distutils to not hardcode interpreter version in shebangs
- fix problem with relative paths when dh's --sourcedirectory is used
- add --name (PYBUILD_NAME) option
+ * dh_python{2,3} and dh_pypy: generate "interpreter (>= X.Y),
+ interpreter (<< X.Z)" dependency if private directory contains extensions
+ even if there are no .py files inside (closes: 720258)
* Disable two tests in test201 dir if /usr/bin/python2.6 is not available
* Replace python-docutils build dependency with python3-docutils (both
provide rst2man)
diff --git a/dhpython/depends.py b/dhpython/depends.py
index a9d0ea9..ed2ea66 100644
--- a/dhpython/depends.py
+++ b/dhpython/depends.py
@@ -142,6 +142,7 @@ class Dependencies:
self.depend(str(ipreter))
supported_versions = supported(self.impl)
+ default_version = default(self.impl)
for private_dir, details in stats['private_dirs'].items():
versions = list(i.version for i in details.get('shebangs', []) if i.version and i.version.minor)
@@ -155,29 +156,29 @@ class Dependencies:
if any(True for i in details.get('shebangs', []) if i.version is None):
self.depend(tpl)
+ extensions = sorted(details.get('ext_vers', set()))
+ #self.depend('|'.join(vtpl % i for i in extensions))
+ if extensions:
+ self.depend("%s (>= %s)" % (tpl, extensions[0]))
+ self.depend("%s (<< %s)" % (tpl, extensions[-1] + 1))
+ elif details.get('ext_no_version'):
+ # assume unrecognized extension was built for default interpreter version
+ self.depend("%s (>= %s)" % (tpl, default_version))
+ self.depend("%s (<< %s)" % (tpl, default_version + 1))
+
if details.get('compile'):
if self.impl in MINPYCDEP:
self.depend(MINPYCDEP[self.impl])
args = ''
- 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])
- if len(extensions) == 1:
- self.depend(vtpl % extensions[0])
- else:
- self.depend("%s (>= %s)" % (tpl, extensions[0]))
- self.depend("%s (<< %s)" % (tpl, extensions[-1] + 1))
+ if extensions:
+ args += "-V %s" % VersionRange(minver=extensions[0], maxver=extensions[-1])
elif len(versions) == 1: # only one version from shebang
#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)
+ args += "-V %s" % default_version
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