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 abf05c185152d57718a026b54e186a4ef0ad257d
Author: Piotr Ożarowski <pi...@debian.org>
Date:   Wed Jul 3 18:37:12 2013 +0200

    Interpreter: enable multiarch for python2.7, fix check_extname
---
 dhpython/interpreter.py | 44 +++++++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 19 deletions(-)

diff --git a/dhpython/interpreter.py b/dhpython/interpreter.py
index 6ff21d6..94d966d 100644
--- a/dhpython/interpreter.py
+++ b/dhpython/interpreter.py
@@ -38,6 +38,7 @@ SHEBANG_RE = re.compile(r'''
     ''', re.VERBOSE)
 EXTFILE_RE = re.compile(r'''
     (?P<name>.*?)
+    (?P<debug>_d)?
     (?:\.
         (?P<stableabi>abi\d+)
      |(?:\.
@@ -45,14 +46,13 @@ EXTFILE_RE = re.compile(r'''
             (?P<impl>cpython|pypy)
             -
             (?P<ver>\d{2})
-            (?P<flags>[a-z]*?)
+            (?P<flags>[a-z]*)
         )?
         (?:
             (?:(?<!\.)-)?  # minus sign only if soabi is defined
             (?P<multiarch>[^/]*?)
         )?
     ))?
-    (?P<debug>_d)?
     \.so$''', re.VERBOSE)
 log = logging.getLogger('dhpython')
 
@@ -331,7 +331,7 @@ class Interpreter:
             soabi, multiarch = self._get_config(version)
         except Exception:
             log.debug('cannot get multiarch', exc_info=True)
-            # interpreter without multiach support
+            # interpreter without multiarch support
             return ''
         return multiarch
 
@@ -371,30 +371,36 @@ class Interpreter:
         if info['stableabi']:
             # files with stable ABI in name don't need changes
             return
+        if info['debug'] and self.debug is False:
+            # do not change Python 2.X extensions already marked as debug
+            # (the other way arround is acceptable)
+            return
 
-        i = Interpreter(self, version=version)
-        if info['ver']:
-            i.version = "{}.{}".format(info['ver'][0], info['ver'][1])
-        if not i.debug and (info['debug'] or 'd' in (info['flags'] or '')):
-            i.debug = True
         try:
-            soabi, multiarch = i._get_config()
+            soabi, multiarch = self._get_config(version)
         except Exception:
             log.debug('cannot get soabi/multiarch', exc_info=True)
             return
+
+        if info['soabi'] and soabi and info['soabi'] != soabi:
+            return
+
+        tmp_soabi = info['soabi'] or soabi
+        tmp_multiarch = info['multiarch'] or multiarch
+
         result = info['name']
-        if i.impl == 'cpython3' and i.version >> '3.2' and 
result.endswith('module'):
+        if self.impl == 'cpython3' and version >> '3.2' and 
result.endswith('module'):
             result = result[:-6]
-        if info['soabi'] or soabi:
-            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':
+        elif self.debug and self.impl == 'cpython2':
             result += '_d'
+
+        if tmp_soabi:
+            result = "{}.{}".format(result, tmp_soabi)
+            if tmp_multiarch:
+                result = "{}-{}".format(result, tmp_multiarch)
+        elif self.impl == 'cpython2' and version == '2.7':
+            result = "{}.{}".format(result, tmp_multiarch)
+
         result += '.so'
         if fname == result:
             return

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

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to