ports/sysutils/py-diffoscope/files/patch-diffoscope_comparators_elf.py
Kubilay Kocak f7da613142 [NEW] sysutils/py-diffoscope: In-depth comparison of files, archives, and directories
diffoscope will try to get to the bottom of what makes files or
directories different. It will recursively unpack archives of many kinds
and transform various binary formats into more human readable form to
compare them. It can compare two tarballs, ISO images, or PDF just as
easily.

It can be scripted through error codes, and a report can be produced
with the detected differences. The report can be text or HTML. When no
type of report has been selected, diffoscope defaults to write a text
report on the standard output.

diffoscope is developed as part of the 'reproducible builds' Deian
project. It is meant to be able to quickly understand why two builds
of the same package produce different outputs. diffoscope was previously
named debbindiff.

WWW: https://diffoscope.org/

Thank you to bapt for providing the background context, information and
the getfacl patch to get this port going.

Requested by:	emaste, bapt (for reproducible builds & FOSDEM talk)
2016-01-31 08:38:33 +00:00

39 lines
1.7 KiB
Python

commit 8df464ebf0db8b04d0baae6a14504f3796e355a0
Author: Jeremy Bobbio <lunar@debian.org>
Date: Sat Jan 30 13:47:47 2016 +0000
Also use libarchive to read metadata from ar archives
The output is more precise and less dependent on binutils version.
The command line `ar` tool is not used any more so remove it from the
required tools.
--- diffoscope/comparators/elf.py.orig 2016-01-31 06:32:02 UTC
+++ diffoscope/comparators/elf.py
@@ -24,8 +24,9 @@ import subprocess
from diffoscope import tool_required, OutputParsingError
from diffoscope import logger
from diffoscope.comparators.binary import File
+from diffoscope.comparators.libarchive import list_libarchive
from diffoscope.comparators.deb import DebFile, get_build_id_map
-from diffoscope.comparators.utils import get_ar_content, Command, Container
+from diffoscope.comparators.utils import Command, Container
from diffoscope.difference import Difference
@@ -415,10 +416,8 @@ class StaticLibFile(File):
def compare_details(self, other, source=None):
differences = []
- # look up differences in metadata
- content1 = get_ar_content(self.path)
- content2 = get_ar_content(other.path)
- differences.append(Difference.from_text(
- content1, content2, self.path, other.path, source="metadata"))
+ differences.append(Difference.from_text_readers(list_libarchive(self.path),
+ list_libarchive(other.path),
+ self.path, other.path, source="file list"))
differences.extend(_compare_elf_data(self.path, other.path))
return differences