[Reproducible-builds] [dh-python] 06/183: use pydist-overrides file names that are already in use
Jérémy Bobbio
lunar at moszumanska.debian.org
Fri Sep 19 15:30:13 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 51ad0540a548c8535ee5243b38e57c705f8d8c58
Author: Piotr Ożarowski <piotr at debian.org>
Date: Sat Jun 29 10:18:54 2013 +0200
use pydist-overrides file names that are already in use
---
dhpython/pydist.py | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/dhpython/pydist.py b/dhpython/pydist.py
index dcf122e..0d9c43a 100644
--- a/dhpython/pydist.py
+++ b/dhpython/pydist.py
@@ -55,6 +55,16 @@ REQUIRES_RE = re.compile(r'''
(?P<version>(\w|[-.])+)
)?
''', re.VERBOSE)
+PYDIST_DIRS = {
+ 'cpython2': '/usr/share/python/dist/',
+ 'cpython3': '/usr/share/python3/dist/',
+ 'pypy': '/usr/share/pypy/dist/',
+}
+OVERRIDES_FILE_NAMES = {
+ 'cpython2': 'debian/pydist-overrides',
+ 'cpython3': 'debian/py3dist-overrides',
+ 'pypy': 'debian/pypydist-overrides',
+}
def validate(fpath):
@@ -72,26 +82,24 @@ def validate(fpath):
@memoize
-def load(impl, dname='/usr/share/dh-python/dist/{}',
- fname='debian/pydist-{}-overrides',
- fbname='/usr/share/dh-python/dist/{}_fallback'):
+def load(impl):
"""Load iformation about installed Python distributions.
:param impl: interpreter implementation, f.e. cpython2, cpython3, pypy
- :param fname: local fallback file name
- :param fbname: global fallback file name
+ :type impl: str
"""
- dname = dname.format(impl)
- fname = fname.format(impl)
- fbname = fbname.format(impl)
-
+ fname = OVERRIDES_FILE_NAMES.get(impl)
if exists(fname):
to_check = [fname] # first one!
else:
to_check = []
+
+ dname = PYDIST_DIRS.get(impl)
if isdir(dname):
to_check.extend(join(dname, i) for i in os.listdir(dname))
- if exists(fbname): # fall back generated at python-defaults build time
+
+ fbname = '/usr/share/dh-python/dist/{}_fallback'.format(impl)
+ if exists(fbname): # fall back generated at dh-python build time
to_check.append(fbname) # last one!
result = {}
--
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