[diffoscope] 02/03: Fix --exclude control.tar.gz

Ximin Luo infinity0 at debian.org
Wed May 24 19:23:29 CEST 2017


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

infinity0 pushed a commit to branch experimental
in repository diffoscope.

commit 1fb402a3f3f01a22de9946486fbd07e7247f0420
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed May 24 18:49:09 2017 +0200

    Fix --exclude control.tar.gz
---
 diffoscope/comparators/deb.py              | 3 ++-
 diffoscope/comparators/utils/libarchive.py | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/diffoscope/comparators/deb.py b/diffoscope/comparators/deb.py
index 3415d83..9a0758e 100644
--- a/diffoscope/comparators/deb.py
+++ b/diffoscope/comparators/deb.py
@@ -85,7 +85,8 @@ class DebFile(File):
     @property
     def md5sums(self):
         if not hasattr(self, '_md5sums'):
-            md5sums_file = self.as_container.control_tar.as_container.lookup_file('./md5sums')
+            control_tar = self.as_container.control_tar
+            md5sums_file = control_tar.as_container.lookup_file('./md5sums') if control_tar else None
             if md5sums_file:
                 self._md5sums = md5sums_file.parse()
             else:
diff --git a/diffoscope/comparators/utils/libarchive.py b/diffoscope/comparators/utils/libarchive.py
index 2271591..1a642d6 100644
--- a/diffoscope/comparators/utils/libarchive.py
+++ b/diffoscope/comparators/utils/libarchive.py
@@ -187,6 +187,8 @@ class LibarchiveContainer(Archive):
     def get_all_members(self):
         with libarchive.file_reader(self.source.path) as archive:
             for entry in archive:
+                if any_excluded(entry.pathname):
+                    continue
                 yield entry.pathname, self.get_subclass(entry)
 
     def get_subclass(self, entry):

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


More information about the diffoscope mailing list