mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 23:40:29 +03:00
update: skip APKs that cannot be parsed instead of exiting
Some APKs can be corrupt or some system APKs do not have all the normal info. Instead of quitting, `fdroid update` skips the non-parsable APKs and optionally deletes them if --delete-unknown is specified.
This commit is contained in:
parent
ed73db65ae
commit
57a4e03277
1 changed files with 9 additions and 2 deletions
|
|
@ -379,8 +379,15 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
||||||
config['build_tools'], 'aapt'),
|
config['build_tools'], 'aapt'),
|
||||||
'dump', 'badging', apkfile])
|
'dump', 'badging', apkfile])
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
logging.critical("Failed to get apk information")
|
if options.delete_unknown:
|
||||||
sys.exit(1)
|
if os.path.exists(apkfile):
|
||||||
|
logging.error("Failed to get apk information, deleting " + apkfile)
|
||||||
|
os.remove(apkfile)
|
||||||
|
else:
|
||||||
|
logging.error("Could not find {0} to remove it".format(apkfile))
|
||||||
|
else:
|
||||||
|
logging.error("Failed to get apk information, skipping " + apkfile)
|
||||||
|
continue
|
||||||
for line in p.stdout.splitlines():
|
for line in p.stdout.splitlines():
|
||||||
if line.startswith("package:"):
|
if line.startswith("package:"):
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue