[Reproducible-commits] [debbindiff] 02/03: Skip archive name in zipinfo output

Jérémy Bobbio lunar at moszumanska.debian.org
Wed Jun 24 14:19:03 UTC 2015


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

lunar pushed a commit to branch master
in repository debbindiff.

commit 023c175ca1f893660b4ed9786142bc314d2fd225
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Jun 24 13:51:24 2015 +0000

    Skip archive name in zipinfo output
---
 debbindiff/comparators/zip.py        | 6 ++++--
 tests/data/zip_zipinfo_expected_diff | 4 +---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/debbindiff/comparators/zip.py b/debbindiff/comparators/zip.py
index 0fb9c51..eb5f71f 100644
--- a/debbindiff/comparators/zip.py
+++ b/debbindiff/comparators/zip.py
@@ -34,8 +34,10 @@ class Zipinfo(Command):
         return ['zipinfo', self.path]
 
     def filter(self, line):
-        # the full path appears in the output, we need to remove it
-        return line.replace(self.path, os.path.basename(self.path))
+        # we don't care about the archive file path
+        if re.match('^Archive:.*', line):
+            return ''
+        return line
 
 
 class ZipinfoVerbose(Zipinfo):
diff --git a/tests/data/zip_zipinfo_expected_diff b/tests/data/zip_zipinfo_expected_diff
index 411af85..b1683bf 100644
--- a/tests/data/zip_zipinfo_expected_diff
+++ b/tests/data/zip_zipinfo_expected_diff
@@ -1,7 +1,5 @@
-@@ -1,5 +1,5 @@
--Archive:  test1.zip
+@@ -1,4 +1,4 @@
 -Zip file size: 571 bytes, number of entries: 2
-+Archive:  test2.zip
 +Zip file size: 714 bytes, number of entries: 2
  drwxr-xr-x  3.0 unx        0 bx stor 15-Jun-24 13:44 dir/
 --rw-r--r--  3.0 unx      446 tx defN 15-Jun-24 13:44 dir/text

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



More information about the Reproducible-commits mailing list