[diffoscope] 01/01: comparators/deb: if --force-details then don't skip files with identical md5sums either
Ximin Luo
infinity0 at debian.org
Thu Sep 21 00:30:34 CEST 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository diffoscope.
commit 9b87bd44cb5bce9d3175dac4724096b010fc394b
Author: Ximin Luo <infinity0 at debian.org>
Date: Wed Sep 20 23:06:32 2017 +0200
comparators/deb: if --force-details then don't skip files with identical md5sums either
---
diffoscope/comparators/deb.py | 4 +++-
diffoscope/comparators/utils/compare.py | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/diffoscope/comparators/deb.py b/diffoscope/comparators/deb.py
index aa7f80f..f2f35a7 100644
--- a/diffoscope/comparators/deb.py
+++ b/diffoscope/comparators/deb.py
@@ -20,6 +20,7 @@
import re
import logging
+from diffoscope.config import Config
from diffoscope.difference import Difference
from .tar import TarContainer
@@ -167,7 +168,8 @@ class DebTarContainer(TarContainer):
other_md5sums = other.source.container.source.container.source.md5sums
for my_member, other_member, comment in super().comparisons(other):
- if my_member.name == other_member.name and \
+ if not Config().force_details and \
+ my_member.name == other_member.name and \
my_md5sums.get(my_member.name, 'my') == other_md5sums.get(other_member.name, 'other'):
logger.debug("Skip %s: identical md5sum", my_member.name)
continue
diff --git a/diffoscope/comparators/utils/compare.py b/diffoscope/comparators/utils/compare.py
index 5ef915f..66a03cd 100644
--- a/diffoscope/comparators/utils/compare.py
+++ b/diffoscope/comparators/utils/compare.py
@@ -82,9 +82,11 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
has_same_content = file1.has_same_content_as(file2)
if has_same_content:
- if not force_details or diff_content_only:
+ if not force_details:
logger.debug("has_same_content_as returned True; skipping further comparisons")
return None
+ if diff_content_only:
+ return None
elif diff_content_only:
assert not has_same_content
return Difference(None, file1.name, file2.name, comment="Files differ")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list