Loading diffoscope/comparators/directory.py +1 −1 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ def xattr(path1, path2): def compare_meta(path1, path2): if Config().exclude_directory_metadata: if Config().exclude_directory_metadata in ('yes', 'recursive'): logger.debug( "Excluding directory metadata for paths (%s, %s)", path1, path2) return [] Loading diffoscope/comparators/utils/compare.py +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ def compare_root_paths(path1, path2): file2 = specialize(FilesystemFile(path2, container=container2)) difference = compare_files(file1, file2) if not Config().exclude_directory_metadata: if Config().exclude_directory_metadata in ('no', 'recursive'): meta = compare_meta(path1, path2) if meta: # Create an "empty" difference so we have something to attach file Loading diffoscope/comparators/utils/libarchive.py +8 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import libarchive import collections from diffoscope.exc import ContainerExtractionError from diffoscope.config import Config from diffoscope.excludes import any_excluded from diffoscope.tempfiles import get_temporary_directory Loading Loading @@ -99,6 +100,13 @@ def list_libarchive(path, ignore_errors=False): try: with libarchive.file_reader(path) as archive: for entry in archive: name_and_link = entry.name if entry.issym: name_and_link = '{entry.name} -> {entry.linkname}'.format( entry=entry) if Config().exclude_directory_metadata == 'recursive': yield '{name_and_link}\n'.format(name_and_link=name_and_link) continue if entry.isblk or entry.ischr: size_or_dev = '{major:>3},{minor:>3}'.format( major=entry.rdevmajor, minor=entry.rdevminor) Loading @@ -106,11 +114,6 @@ def list_libarchive(path, ignore_errors=False): size_or_dev = entry.size mtime = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(entry.mtime) ) + '.{:06d}'.format(entry.mtime_nsec // 1000) if entry.issym: name_and_link = '{entry.name} -> {entry.linkname}'.format( entry=entry) else: name_and_link = entry.name if entry.uname: user = '{user:<8} {uid:>7}'.format(user=entry.uname.decode( 'utf-8', errors='surrogateescape'), uid='({})'.format(entry.uid)) Loading diffoscope/comparators/zip.py +8 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import shutil import os.path import zipfile from diffoscope.config import Config from diffoscope.tools import tool_required from diffoscope.difference import Difference from diffoscope.exc import ContainerExtractionError Loading Loading @@ -163,6 +164,8 @@ class ZipFile(File): def compare_details(self, other, source=None): differences = [] zipinfo_difference = None if Config().exclude_directory_metadata != 'recursive': zipinfo_difference = Difference.from_command(Zipinfo, self.path, other.path) or \ Difference.from_command(ZipinfoVerbose, self.path, other.path) or \ Difference.from_command(BsdtarVerbose, self.path, other.path) Loading Loading @@ -218,6 +221,8 @@ class MozillaZipFile(File): return file.file_header[4:8] == b'PK\x01\x02' def compare_details(self, other, source=None): if Config().exclude_directory_metadata == 'recursive': return [] zipinfo_difference = Difference.from_command(MozillaZipinfo, self.path, other.path) or \ Difference.from_command(MozillaZipinfoVerbose, self.path, other.path) or \ Difference.from_command(BsdtarVerbose, self.path, other.path) Loading diffoscope/config.py +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class Config(object): self.enforce_constraints = True self.excludes = () self.exclude_commands = () self.exclude_directory_metadata = False self.exclude_directory_metadata = 'no' self.compute_visual_diffs = False self.max_container_depth = 50 self.use_dbgsym = False Loading Loading
diffoscope/comparators/directory.py +1 −1 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ def xattr(path1, path2): def compare_meta(path1, path2): if Config().exclude_directory_metadata: if Config().exclude_directory_metadata in ('yes', 'recursive'): logger.debug( "Excluding directory metadata for paths (%s, %s)", path1, path2) return [] Loading
diffoscope/comparators/utils/compare.py +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ def compare_root_paths(path1, path2): file2 = specialize(FilesystemFile(path2, container=container2)) difference = compare_files(file1, file2) if not Config().exclude_directory_metadata: if Config().exclude_directory_metadata in ('no', 'recursive'): meta = compare_meta(path1, path2) if meta: # Create an "empty" difference so we have something to attach file Loading
diffoscope/comparators/utils/libarchive.py +8 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import libarchive import collections from diffoscope.exc import ContainerExtractionError from diffoscope.config import Config from diffoscope.excludes import any_excluded from diffoscope.tempfiles import get_temporary_directory Loading Loading @@ -99,6 +100,13 @@ def list_libarchive(path, ignore_errors=False): try: with libarchive.file_reader(path) as archive: for entry in archive: name_and_link = entry.name if entry.issym: name_and_link = '{entry.name} -> {entry.linkname}'.format( entry=entry) if Config().exclude_directory_metadata == 'recursive': yield '{name_and_link}\n'.format(name_and_link=name_and_link) continue if entry.isblk or entry.ischr: size_or_dev = '{major:>3},{minor:>3}'.format( major=entry.rdevmajor, minor=entry.rdevminor) Loading @@ -106,11 +114,6 @@ def list_libarchive(path, ignore_errors=False): size_or_dev = entry.size mtime = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(entry.mtime) ) + '.{:06d}'.format(entry.mtime_nsec // 1000) if entry.issym: name_and_link = '{entry.name} -> {entry.linkname}'.format( entry=entry) else: name_and_link = entry.name if entry.uname: user = '{user:<8} {uid:>7}'.format(user=entry.uname.decode( 'utf-8', errors='surrogateescape'), uid='({})'.format(entry.uid)) Loading
diffoscope/comparators/zip.py +8 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import shutil import os.path import zipfile from diffoscope.config import Config from diffoscope.tools import tool_required from diffoscope.difference import Difference from diffoscope.exc import ContainerExtractionError Loading Loading @@ -163,6 +164,8 @@ class ZipFile(File): def compare_details(self, other, source=None): differences = [] zipinfo_difference = None if Config().exclude_directory_metadata != 'recursive': zipinfo_difference = Difference.from_command(Zipinfo, self.path, other.path) or \ Difference.from_command(ZipinfoVerbose, self.path, other.path) or \ Difference.from_command(BsdtarVerbose, self.path, other.path) Loading Loading @@ -218,6 +221,8 @@ class MozillaZipFile(File): return file.file_header[4:8] == b'PK\x01\x02' def compare_details(self, other, source=None): if Config().exclude_directory_metadata == 'recursive': return [] zipinfo_difference = Difference.from_command(MozillaZipinfo, self.path, other.path) or \ Difference.from_command(MozillaZipinfoVerbose, self.path, other.path) or \ Difference.from_command(BsdtarVerbose, self.path, other.path) Loading
diffoscope/config.py +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class Config(object): self.enforce_constraints = True self.excludes = () self.exclude_commands = () self.exclude_directory_metadata = False self.exclude_directory_metadata = 'no' self.compute_visual_diffs = False self.max_container_depth = 50 self.use_dbgsym = False Loading