[diffoscope] 07/09: Revert "utils.libarchive: No need to track archive directory locations."

Maria Glukhova siamezzze-guest at moszumanska.debian.org
Mon Feb 13 20:39:59 CET 2017


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

siamezzze-guest pushed a commit to branch siamezzze/containers
in repository diffoscope.

commit c9a83a97c593a53a472db8c01ccf503cd4e6677f
Author: Maria Glukhova <siamezzze at gmail.com>
Date:   Mon Feb 13 21:01:06 2017 +0200

    Revert "utils.libarchive: No need to track archive directory locations."
    
    Skipping directories while unpacking libarchive means that
    directories are not listed in get_member_names(). That leads to
    a difference in behavior between different archive types
    (e.g. for ZIP-files get_member_names() still returns full file
    list including directories). That could also lead to a confusion
    in case of empty directories.
    
    This reverts commit acebcc0b0d4192d34ada8e8d1e84bc64dcf5b8c8.
---
 diffoscope/comparators/utils/libarchive.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/diffoscope/comparators/utils/libarchive.py b/diffoscope/comparators/utils/libarchive.py
index 4924a31..5b9618e 100644
--- a/diffoscope/comparators/utils/libarchive.py
+++ b/diffoscope/comparators/utils/libarchive.py
@@ -209,10 +209,6 @@ class LibarchiveContainer(Archive):
 
         with libarchive.file_reader(self.source.path) as archive:
             for idx, entry in enumerate(archive):
-                # Always skip directories
-                if entry.isdir:
-                    continue
-
                 # Save extracting excluded files
                 if any_excluded(entry.pathname):
                     continue
@@ -222,6 +218,9 @@ class LibarchiveContainer(Archive):
                 dst = os.path.join(tmpdir, str(idx))
                 self._members[entry.pathname] = dst
 
+                if entry.isdir:
+                    continue
+
                 logger.debug("Extracting %s to %s", entry.pathname, dst)
 
                 with open(dst, 'wb') as f:

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


More information about the diffoscope mailing list