mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
Guarded against an icon specified in the manifest that doesn't actually exist
This commit is contained in:
parent
4535d36a6c
commit
e7bbf68272
@ -54,6 +54,8 @@ if os.path.exists(icon_dir):
|
|||||||
shutil.rmtree(icon_dir)
|
shutil.rmtree(icon_dir)
|
||||||
os.mkdir(icon_dir)
|
os.mkdir(icon_dir)
|
||||||
|
|
||||||
|
warnings = 0
|
||||||
|
|
||||||
#Make sure we have the repository description...
|
#Make sure we have the repository description...
|
||||||
if (repo_url is None or repo_name is None or
|
if (repo_url is None or repo_name is None or
|
||||||
repo_icon is None or repo_description is None):
|
repo_icon is None or repo_description is None):
|
||||||
@ -133,9 +135,13 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')):
|
|||||||
thisinfo['icon'] = (thisinfo['id'] + '.' +
|
thisinfo['icon'] = (thisinfo['id'] + '.' +
|
||||||
thisinfo['versioncode'] + '.png')
|
thisinfo['versioncode'] + '.png')
|
||||||
iconfilename = os.path.join(icon_dir, thisinfo['icon'])
|
iconfilename = os.path.join(icon_dir, thisinfo['icon'])
|
||||||
|
try:
|
||||||
iconfile = open(iconfilename, 'wb')
|
iconfile = open(iconfilename, 'wb')
|
||||||
iconfile.write(apk.read(thisinfo['iconsrc']))
|
iconfile.write(apk.read(thisinfo['iconsrc']))
|
||||||
iconfile.close()
|
iconfile.close()
|
||||||
|
except:
|
||||||
|
print "WARNING: Error retrieving icon file"
|
||||||
|
warnings += 1
|
||||||
apk.close()
|
apk.close()
|
||||||
|
|
||||||
apks.append(thisinfo)
|
apks.append(thisinfo)
|
||||||
@ -211,7 +217,6 @@ root.appendChild(repoel)
|
|||||||
|
|
||||||
apps_inrepo = 0
|
apps_inrepo = 0
|
||||||
apps_disabled = 0
|
apps_disabled = 0
|
||||||
warnings = 0
|
|
||||||
|
|
||||||
for app in apps:
|
for app in apps:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user