[diffoscope] 01/01: Handle /SYM64/ entries in .a archives

Ximin Luo infinity0 at debian.org
Wed Nov 9 21:24:52 CET 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch pu/libarchive_support_sym64
in repository diffoscope.

commit a986edc1997723ea0f4a5eaae08d25ae33117c06
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Nov 9 20:13:25 2016 +0100

    Handle /SYM64/ entries in .a archives
---
 diffoscope/comparators/libarchive.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/diffoscope/comparators/libarchive.py b/diffoscope/comparators/libarchive.py
index e2536c1..8edafa4 100644
--- a/diffoscope/comparators/libarchive.py
+++ b/diffoscope/comparators/libarchive.py
@@ -167,9 +167,10 @@ class LibarchiveContainer(Archive):
         return member_names
 
     def extract(self, member_name, dest_dir):
-        dest_name = os.path.basename(member_name)
+        # sometimes symbol names are like "/SYM64/" and we need to strip the /
+        dest_name = os.path.basename(member_name.rstrip("/"))
         if not dest_name:
-            raise ValueError('member_name should not be a directory')
+            raise ValueError('member_name should not be a directory: %s' % member_name)
         dest_path = os.path.join(dest_dir, dest_name)
         logger.debug('libarchive extracting %s to %s', member_name, dest_path)
         with libarchive.file_reader(self.source.path) as archive:

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


More information about the diffoscope mailing list