mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
Revert "Switch to python-magic from PIL"
This reverts commit 8541cdf893
.
This commit is contained in:
parent
f69dbd3e9e
commit
2efce6cc69
1 changed files with 5 additions and 1 deletions
|
@ -1186,6 +1186,9 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||||
scanignore = getpaths('scanignore')
|
scanignore = getpaths('scanignore')
|
||||||
scandelete = getpaths('scandelete')
|
scandelete = getpaths('scandelete')
|
||||||
|
|
||||||
|
ms = magic.open(magic.MIME_TYPE)
|
||||||
|
ms.load()
|
||||||
|
|
||||||
def toignore(fd):
|
def toignore(fd):
|
||||||
for i in scanignore:
|
for i in scanignore:
|
||||||
if fd.startswith(i):
|
if fd.startswith(i):
|
||||||
|
@ -1234,7 +1237,7 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||||
if suspect in curfile.lower():
|
if suspect in curfile.lower():
|
||||||
handleproblem('usual supect', fd, fp)
|
handleproblem('usual supect', fd, fp)
|
||||||
|
|
||||||
mime = magic.from_file(fp, mime=True)
|
mime = ms.file(fp)
|
||||||
if mime == 'application/x-sharedlib':
|
if mime == 'application/x-sharedlib':
|
||||||
handleproblem('shared library', fd, fp)
|
handleproblem('shared library', fd, fp)
|
||||||
elif mime == 'application/x-archive':
|
elif mime == 'application/x-archive':
|
||||||
|
@ -1251,6 +1254,7 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||||
if 'DexClassLoader' in line:
|
if 'DexClassLoader' in line:
|
||||||
handleproblem('DexClassLoader', fd, fp)
|
handleproblem('DexClassLoader', fd, fp)
|
||||||
break
|
break
|
||||||
|
ms.close()
|
||||||
|
|
||||||
# Presence of a jni directory without buildjni=yes might
|
# Presence of a jni directory without buildjni=yes might
|
||||||
# indicate a problem (if it's not a problem, explicitly use
|
# indicate a problem (if it's not a problem, explicitly use
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue