[Reproducible-commits] [debbindiff] 01/01: Look harder for differences in zip files if needed
Jérémy Bobbio
lunar at moszumanska.debian.org
Fri Oct 3 19:24:09 UTC 2014
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository debbindiff.
commit 107ddcd62023c0c24c8d5fbb99167afa73717e8f
Author: Jérémy Bobbio <lunar at debian.org>
Date: Fri Oct 3 21:23:02 2014 +0200
Look harder for differences in zip files if needed
Some jar files contained no apparant differences in plain `zipinfo`,
but showed some in `zipinfo -v`. The former is more readable, so still try
to get some result with it first.
---
debbindiff/comparators/zip.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/debbindiff/comparators/zip.py b/debbindiff/comparators/zip.py
index a073fec..78da265 100644
--- a/debbindiff/comparators/zip.py
+++ b/debbindiff/comparators/zip.py
@@ -27,8 +27,12 @@ import debbindiff.comparators
from debbindiff.comparators.utils import binary_fallback, make_temp_directory
-def get_zipinfo(path):
- output = subprocess.check_output(['zipinfo', path], shell=False)
+def get_zipinfo(path, verbose=False):
+ if verbose:
+ cmd = ['zipinfo', '-v', path]
+ else:
+ cmd = ['zipinfo', path]
+ output = subprocess.check_output(cmd, shell=False)
# the full path appears in the output, we need to remove it
return re.sub(re.escape(path), os.path.basename(path), output)
@@ -60,6 +64,10 @@ def compare_zip_files(path1, path2, source=None):
# look up differences in metadata
zipinfo1 = get_zipinfo(path1)
zipinfo2 = get_zipinfo(path2)
+ if zipinfo1 == zipinfo2:
+ # search harder
+ zipinfo1 = get_zipinfo(path1, verbose=True)
+ zipinfo2 = get_zipinfo(path2, verbose=True)
if zipinfo1 != zipinfo2:
differences.append(Difference(
zipinfo1.splitlines(1), zipinfo2.splitlines(1),
--
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