[Git][reproducible-builds/diffoscope][master] Not all versions of file(1) support detection of Jmod files yet, so perform a...
Chris Lamb
gitlab at salsa.debian.org
Mon Jul 29 14:56:22 UTC 2019
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
6a1769c9 by Chris Lamb at 2019-07-29T14:55:37Z
Not all versions of file(1) support detection of Jmod files yet, so perform a manual comparison instead. (re. reproducible-builds/diffoscope#60)
- - - - -
2 changed files:
- diffoscope/comparators/__init__.py
- diffoscope/comparators/zip.py
Changes:
=====================================
diffoscope/comparators/__init__.py
=====================================
@@ -88,8 +88,8 @@ class ComparatorManager(object):
('ocaml.OcamlInterfaceFile',),
('docx.DocxFile',),
('zip.MozillaZipFile',),
- ('zip.ZipFile',),
('zip.JmodJavaModule',),
+ ('zip.ZipFile',),
('image.JPEGImageFile',),
('image.ICOImageFile',),
('cbfs.CbfsFile',),
=====================================
diffoscope/comparators/zip.py
=====================================
@@ -250,7 +250,13 @@ class MozillaZipFile(ZipFile):
class JmodJavaModule(ZipFile):
DESCRIPTION = 'Java .jmod modules'
- FILE_TYPE_RE = re.compile(r'^Java jmod module\b')
+ FILE_TYPE_RE = re.compile(r'^(Zip archive data|Java jmod module)')
ZIPINFO = IgnoreReturncodeZipinfo
ZIPINFO_VERBOSE = IgnoreReturncodeZipinfoVerbose
+
+ @classmethod
+ def recognizes(cls, file):
+ # Not all versions of file(1) support the detection of these
+ # modules yet so we perform our own manual check for a "JM" prefix.
+ return file.file_header[:2] == b'JM'
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/6a1769c972532ef1a1d5a09a87fa6f3741399f53
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/6a1769c972532ef1a1d5a09a87fa6f3741399f53
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190729/e163894d/attachment.html>
More information about the rb-commits
mailing list