[Git][reproducible-builds/diffoscope][master] Support .deb archives that contain an uncompressed control.tar. Thanks to…
Chris Lamb
gitlab at salsa.debian.org
Mon Jul 9 14:38:55 CEST 2018
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
dc9ee98b by Chris Lamb at 2018-07-09T14:38:31+02:00
Support .deb archives that contain an uncompressed control.tar. Thanks to Roderich Schupp <roderich.schupp at gmail.com> for the bug report. (Closes: #903391)
- - - - -
4 changed files:
- diffoscope/comparators/deb.py
- tests/comparators/test_deb.py
- + tests/data/bug903391_1.deb
- + tests/data/bug903391_2.deb
Changes:
=====================================
diffoscope/comparators/deb.py
=====================================
--- a/diffoscope/comparators/deb.py
+++ b/diffoscope/comparators/deb.py
@@ -110,7 +110,7 @@ class DebFile(File):
control_tar = self.as_container.control_tar
md5sums_file = control_tar.as_container.lookup_file(
'./md5sums') if control_tar else None
- if md5sums_file:
+ if isinstance(md5sums_file, Md5sumsFile):
self._md5sums = md5sums_file.parse()
else:
logger.debug("Unable to find a md5sums file")
=====================================
tests/comparators/test_deb.py
=====================================
--- a/tests/comparators/test_deb.py
+++ b/tests/comparators/test_deb.py
@@ -130,6 +130,8 @@ def test_compare_non_existing(monkeypatch, deb1):
bug881937_deb1 = load_fixture('bug881937_1.deb')
bug881937_deb2 = load_fixture('bug881937_2.deb')
+bug903391_deb1 = load_fixture('bug903391_1.deb')
+bug903391_deb2 = load_fixture('bug903391_2.deb')
@skip_unless_tools_exist('xz')
@@ -139,3 +141,7 @@ def test_compare_different_compression(bug881937_deb1, bug881937_deb2):
assert difference.details[1].source2 == 'control.tar.xz'
expected_diff = get_data('bug881937_control_expected_diff')
assert difference.details[1].details[2].details[1].unified_diff == expected_diff
+
+
+def test_uncompressed_control_tar(bug903391_deb1, bug903391_deb2):
+ bug903391_deb1.compare(bug903391_deb2)
=====================================
tests/data/bug903391_1.deb
=====================================
Binary files /dev/null and b/tests/data/bug903391_1.deb differ
=====================================
tests/data/bug903391_2.deb
=====================================
Binary files /dev/null and b/tests/data/bug903391_2.deb differ
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/dc9ee98bdfce7d1a9564fab6e35f57802d6854f4
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/dc9ee98bdfce7d1a9564fab6e35f57802d6854f4
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20180709/58cb3c8e/attachment.html>
More information about the rb-commits
mailing list