Skip to content
Snippets Groups Projects
Commit 6a1769c9 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

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
No related branches found
No related tags found
No related merge requests found
Pipeline #59765 passed with warnings
......@@ -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'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment