[diffoscope] 01/02: Add some more documentation for ArFile/ArContainer

Ximin Luo infinity0 at debian.org
Mon Jul 18 21:35:36 CEST 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository diffoscope.

commit 63ce5bf26a6a784bfa3e3adf1fe5a425c7044a30
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Jul 18 21:33:09 2016 +0200

    Add some more documentation for ArFile/ArContainer
---
 diffoscope/comparators/ar.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/diffoscope/comparators/ar.py b/diffoscope/comparators/ar.py
index d77e723..414557d 100644
--- a/diffoscope/comparators/ar.py
+++ b/diffoscope/comparators/ar.py
@@ -26,14 +26,23 @@ from diffoscope.comparators.libarchive import LibarchiveContainer, list_libarchi
 from diffoscope.comparators.utils import Command, tool_required
 from diffoscope import logger
 
+# TODO: this would also be useful for Go archives. Currently those are handled
+# by StaticLibFile, but then readelf complains with "Error: Not an ELF file".
+# ArFile gives slightly more reasonable output, e.g. a readable plain diff of
+# the __.PKGDEF member which is just a text file containing the Go interface.
+
 class ArContainer(LibarchiveContainer):
     def get_members(self):
         members = LibarchiveContainer.get_members(self)
         cls = members.__class__
-        # for some reason libarchive outputs / and // as member names
-        # filter these out, otherwise they cause exceptions later
+        # for some reason libarchive outputs ["/", "//"] as member names for
+        # some archives. for now, let's just filter these out, otherwise they
+        # cause exceptions later. eventually, we should investigate this in
+        # more detail and handle it properly.
         filtered_out = cls([p for p in members.items() if not os.path.basename(p[0])])
-        logger.debug("ignored ar members %s, probably a libarchive bug", list(filtered_out.keys()))
+        if filtered_out:
+            logger.debug("ignored directory ar members %s in %s, don't yet know how to handle these",
+                list(filtered_out.keys()), self.source.path)
         return cls([p for p in members.items() if os.path.basename(p[0])])
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list