Commit 6a1769c9 authored by Chris Lamb's avatar Chris Lamb 💬

Not all versions of file(1) support detection of Jmod files yet, so perform a...

Not all versions of file(1) support detection of Jmod files yet, so perform a manual comparison instead. (re. #60)
parent 4af81ba2
Pipeline #59765 passed with stage
in 16 minutes and 39 seconds
......@@ -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',),
......
......@@ -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'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment