[Reproducible-builds] [dh-python] 146/183: dh_python2: fix renaming debug extensions with multiarch tuples

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Sep 19 15:30:31 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 bf2bef72e5792062519aa477649c0cbe630b4d2d
Author: Piotr Ożarowski <piotr at debian.org>
Date:   Mon Oct 21 08:36:18 2013 +0200

    dh_python2: fix renaming debug extensions with multiarch tuples
---
 debian/changelog          |  6 ++++++
 dhpython/interpreter.py   |  6 +++---
 tests/test_interpreter.py | 12 ++++++------
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7a73c51..b88b6f1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+dh-python (1.20131021-1) UNRELEASED; urgency=low
+
+  * dh_python2: fix renaming debug extensions with multiarch tuples
+
+ -- Piotr Ożarowski <piotr at debian.org>  Mon, 21 Oct 2013 08:34:53 +0200
+
 dh-python (1.20131017-1) unstable; urgency=low
 
   [ Stefano Rivera ]
diff --git a/dhpython/interpreter.py b/dhpython/interpreter.py
index 22ec1c8..2aad6ed 100644
--- a/dhpython/interpreter.py
+++ b/dhpython/interpreter.py
@@ -38,7 +38,6 @@ SHEBANG_RE = re.compile(r'''
     ''', re.VERBOSE)
 EXTFILE_RE = re.compile(r'''
     (?P<name>.*?)
-    (?P<debug>_d)?
     (?:\.
         (?P<stableabi>abi\d+)
      |(?:\.
@@ -53,6 +52,7 @@ EXTFILE_RE = re.compile(r'''
             (?P<multiarch>[^/]*?)
         )?
     ))?
+    (?P<debug>_d)?
     \.so$''', re.VERBOSE)
 log = logging.getLogger('dhpython')
 
@@ -453,8 +453,6 @@ class Interpreter:
         result = info['name']
         if self.impl == 'cpython3' and version >> '3.2' and result.endswith('module'):
             result = result[:-6]
-        elif self.debug and self.impl == 'cpython2':
-            result += '_d'
 
         if tmp_soabi:
             result = "{}.{}".format(result, tmp_soabi)
@@ -463,6 +461,8 @@ class Interpreter:
         elif self.impl == 'cpython2' and version == '2.7' and tmp_multiarch:
             result = "{}.{}".format(result, tmp_multiarch)
 
+        if self.debug and self.impl == 'cpython2':
+            result += '_d'
         result += '.so'
         if fname == result:
             return
diff --git a/tests/test_interpreter.py b/tests/test_interpreter.py
index 832639e..7078372 100644
--- a/tests/test_interpreter.py
+++ b/tests/test_interpreter.py
@@ -42,7 +42,7 @@ class TestInterpreter(unittest.TestCase):
         i = Interpreter('python2.7')
         self.assertEqual(i.soabi(), '')
         self.assertEqual(i.check_extname('foo.so'), 'foo.MYARCH.so')
-        self.assertIsNone(i.check_extname('foo_d.MYARCH.so'))
+        self.assertIsNone(i.check_extname('foo.MYARCH_d.so'))
         self.assertIsNone(i.check_extname('foo.abi3.so'))
         self.assertIsNone(i.check_extname('foo.OTHER.so'))  # different architecture
         self.assertEqual(i.check_extname('foo/bar/bazmodule.so'), 'foo/bar/bazmodule.MYARCH.so')
@@ -51,11 +51,11 @@ class TestInterpreter(unittest.TestCase):
     def test_python27dbg(self):
         i = Interpreter('python2.7-dbg')
         self.assertEqual(i.soabi(), '')
-        self.assertEqual(i.check_extname('foo.so'), 'foo_d.MYARCH.so')
-        self.assertEqual(i.check_extname('foo_d.so'), 'foo_d.MYARCH.so')
-        self.assertIsNone(i.check_extname('foo_d.MYARCH.so'))
-        self.assertIsNone(i.check_extname('foo_d.OTHER.so'))  # different architecture
-        self.assertEqual(i.check_extname('foo/bar/bazmodule.so'), 'foo/bar/bazmodule_d.MYARCH.so')
+        self.assertEqual(i.check_extname('foo.so'), 'foo.MYARCH_d.so')
+        self.assertEqual(i.check_extname('foo_d.so'), 'foo.MYARCH_d.so')
+        self.assertIsNone(i.check_extname('foo.MYARCH_d.so'))
+        self.assertIsNone(i.check_extname('foo.OTHER_d.so'))  # different architecture
+        self.assertEqual(i.check_extname('foo/bar/bazmodule.so'), 'foo/bar/bazmodule.MYARCH_d.so')
 
     @unittest.skipUnless(exists('/usr/bin/python3.1'), 'python3.1 is not installed')
     def test_python31(self):

-- 
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