mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 14:30:11 +01:00
Switch to python-magic from PIL
This commit is contained in:
parent
7bf74d47bb
commit
8541cdf893
@ -1186,9 +1186,6 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||
scanignore = getpaths('scanignore')
|
||||
scandelete = getpaths('scandelete')
|
||||
|
||||
ms = magic.open(magic.MIME_TYPE)
|
||||
ms.load()
|
||||
|
||||
def toignore(fd):
|
||||
for i in scanignore:
|
||||
if fd.startswith(i):
|
||||
@ -1237,7 +1234,7 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||
if suspect in curfile.lower():
|
||||
handleproblem('usual supect', fd, fp)
|
||||
|
||||
mime = ms.file(fp)
|
||||
mime = magic.from_file(fp, mime=True)
|
||||
if mime == 'application/x-sharedlib':
|
||||
handleproblem('shared library', fd, fp)
|
||||
elif mime == 'application/x-archive':
|
||||
@ -1254,7 +1251,6 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||
if 'DexClassLoader' in line:
|
||||
handleproblem('DexClassLoader', fd, fp)
|
||||
break
|
||||
ms.close()
|
||||
|
||||
# Presence of a jni directory without buildjni=yes might
|
||||
# indicate a problem (if it's not a problem, explicitly use
|
||||
|
Loading…
Reference in New Issue
Block a user