Commit 9b87bd44 authored by Ximin Luo's avatar Ximin Luo

comparators/deb: if --force-details then don't skip files with identical md5sums either

parent 0fb6d8ab
......@@ -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
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment