[diffoscope] What file to diff on after root paths are compared?
Chris Lamb
chris at reproducible-builds.org
Tue Dec 31 13:00:17 UTC 2024
Hello Aman,
> My question is how does it know which files to diff over? For
> example, consider the diff output below between two jars. It first
> runs some zip archive related tools and then shows the diff between
> the files (MANIFEST and properties file) that was actually causing
> the changes in the archive. Does diffoscope know about these files
> from zipinfo/zipnote/zipdetails output or does it simply diff over
> all files in the archive?
The latter; it diffs all files within the archive, regardless of what
zipinfo, zipnote and zipdetails might say — the output of these tools
is not parsed.
The mechanism for this is not entirely clear within diffoscope's
codebase, however, This is partly because of the ways diffoscope
itself provides an abstraction layer to support many different file
formats, but also because, for the majority of archive types, the
actual extraction process is delegated to the libarchive library.
You can see this in action within diffoscope/comparators/utils/libarchive.py,
where a call to get_member_names() calls ensure_unpacked() and thereby
extracting the archive's contents to a temporary directory.
Best wishes,
--
o
⬋ ⬊ Chris Lamb
o o reproducible-builds.org 💠
⬊ ⬋
o
More information about the diffoscope
mailing list