[diffoscope] 02/02: Extract libarchive contents with a file extension
Ximin Luo
infinity0 at debian.org
Tue Nov 28 19:49:47 CET 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository diffoscope.
commit a7c1d23b34cfcfa501237812be2acf82f54bd305
Author: Mike Hommey <mh at glandium.org>
Date: Fri Oct 20 20:36:54 2017 +0900
Extract libarchive contents with a file extension
Some of the commands running on extracted content, like javap, require a
specific file extension to work, so the original extension is better
preserved.
---
diffoscope/comparators/utils/libarchive.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/diffoscope/comparators/utils/libarchive.py b/diffoscope/comparators/utils/libarchive.py
index db953a5..0f8cb4b 100644
--- a/diffoscope/comparators/utils/libarchive.py
+++ b/diffoscope/comparators/utils/libarchive.py
@@ -222,6 +222,8 @@ class LibarchiveContainer(Archive):
# Keep directory sizes small. could be improved but should be
# good enough for "ordinary" large archives.
dst = os.path.join(tmpdir, str(idx // 4096), str(idx % 4096))
+ root, ext = os.path.splitext(entry.pathname)
+ dst += ext
# Maintain a mapping of archive path to the extracted path,
# avoiding the need to sanitise filenames.
self._members[entry.pathname] = dst
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list