[Reproducible-builds] [dh-python] 19/183: dh_python2: add multiarch support (disabled for now)
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 5fba16519475b2b7019102b4cd5755948a9cfcf4
Author: Piotr Ożarowski <piotr at debian.org>
Date: Sun Jun 30 01:38:46 2013 +0200
dh_python2: add multiarch support (disabled for now)
---
dh_python2 | 11 +++++++++++
dhpython/interpreter.py | 23 ++++++++---------------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/dh_python2 b/dh_python2
index 566b9b2..c43ff9f 100755
--- a/dh_python2
+++ b/dh_python2
@@ -366,6 +366,17 @@ def scan(package, dname=None, options=None):
fext not in ('so', 'h'):
os.remove(join(root, fn))
continue
+ # assume all extensions were build for cPython
+ if fext == 'so':
+ new_fn = interpreter.check_extname(fn, version)
+ if new_fn:
+ new_fpath = join(root, new_fn)
+ if exists(new_fpath):
+ log.warn('destination file exist, '
+ 'cannot rename %s to %s', fn, new_fn)
+ else:
+ log.warn('renaming %s to %s', fn, new_fn)
+ os.rename(fpath, new_fpath)
elif private_dir:
if exists(fpath) and fext != 'so':
diff --git a/dhpython/interpreter.py b/dhpython/interpreter.py
index 73c2a76..3140567 100644
--- a/dhpython/interpreter.py
+++ b/dhpython/interpreter.py
@@ -46,9 +46,10 @@ EXTFILE_RE = re.compile(r'''
-
(?P<ver>\d{2})
(?P<flags>[a-z]*?)
- )
+ )?
(?:
- -(?P<multiarch>[^/]*?)
+ (?:(?<!\.)-)? # minus sign only if soabi is defined
+ (?P<multiarch>[^/]*?)
)?
))?
(?P<debug>_d)?
@@ -299,19 +300,6 @@ class Interpreter:
return join(fdir, '__pycache__', "%s.%s.py%s" %
(fname[:-3], self.magic_tag(version), last_char))
- def ext_file(self, name, version=None):
- """Return extension name with soname and multiarch tags."""
- version = Version(version or self.version)
- soabi, multiarch = self._get_config(version)
- result = name.split('.', 1)[0]
- if soabi:
- result += '.{}'.format(soabi)
- if multiarch:
- result += '-{}'.format(multiarch)
- if self.debug and self.impl == 'cpython2':
- result += '_d'
- return '{}.so'.format(result)
-
def magic_number(self, version=None):
"""Return magic number."""
version = Version(version or self.version)
@@ -397,7 +385,12 @@ class Interpreter:
result = "{}.{}".format(result, info['soabi'] or soabi)
if info['multiarch'] or multiarch:
result = "{}-{}".format(result, info['multiarch'] or multiarch)
+ # uncomment next two lines to enable multiarch renaming in Python 2.7
+ #elif i.impl == 'cpython2' and i.version == '2.7':
+ # result = "{}.{}".format(result, info['multiarch'] or multiarch)
+ if self.debug and self.impl == 'cpython2':
+ result += '_d'
result += '.so'
if fname == result:
return
--
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