[Reproducible-commits] [debbindiff] 01/01: Also compare gzip metadata of ipk files

Reiner Herrmann reiner at reiner-h.de
Sat Jun 13 19:33:52 UTC 2015


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

deki-guest pushed a commit to branch master
in repository debbindiff.

commit 4a0b7f2a4e07c2b6e2b8e1738bf5c12158e00b2e
Author: Reiner Herrmann <reiner at reiner-h.de>
Date:   Sat Jun 13 21:33:49 2015 +0200

    Also compare gzip metadata of ipk files
---
 debbindiff/comparators/ipk.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/debbindiff/comparators/ipk.py b/debbindiff/comparators/ipk.py
index adc2e10..240e2f7 100644
--- a/debbindiff/comparators/ipk.py
+++ b/debbindiff/comparators/ipk.py
@@ -17,15 +17,29 @@
 # You should have received a copy of the GNU General Public License
 # along with debbindiff.  If not, see <http://www.gnu.org/licenses/>.
 
+import os.path
 from debbindiff.comparators.utils import binary_fallback
 from debbindiff.comparators.tar import compare_tar_files
-from debbindiff.comparators.gzip import decompress_gzip
+from debbindiff.comparators.gzip import decompress_gzip, get_gzip_metadata
+from debbindiff.difference import Difference
 
 @binary_fallback
 # ipk packages are just .tar.gz archives
 def compare_ipk_files(path1, path2, source=None):
     differences = []
+
+    # metadata
+    metadata1 = get_gzip_metadata(path1)
+    metadata2 = get_gzip_metadata(path2)
+    difference = Difference.from_unicode(
+                     metadata1, metadata2, path1, path2, source='metadata')
+    if difference:
+        differences.append(difference)
+
+    # content
     with decompress_gzip(path1) as tar1:
         with decompress_gzip(path2) as tar2:
-            differences = compare_tar_files(tar1, tar2, source=source)
+            differences.extend(compare_tar_files(tar1, tar2,
+                    source=[os.path.basename(tar1), os.path.basename(tar2)]))
+
     return differences

-- 
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