1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-05 06:50:10 +01:00

update: remove icons when removing disabled builds

They were just left there forever.
This commit is contained in:
Daniel Martí 2015-11-27 00:23:59 +01:00
parent 47812ccc24
commit 301302d76e

View File

@ -291,18 +291,28 @@ def delete_disabled_builds(apps, apkcache, repodirs):
""" """
for appid, app in apps.iteritems(): for appid, app in apps.iteritems():
for build in app['builds']: for build in app['builds']:
if build['disable']: if not build['disable']:
apkfilename = appid + '_' + str(build['vercode']) + '.apk' continue
for repodir in repodirs: apkfilename = appid + '_' + str(build['vercode']) + '.apk'
apkpath = os.path.join(repodir, apkfilename) iconfilename = "%s.%s.png" % (
ascpath = apkpath + ".asc" appid,
srcpath = os.path.join(repodir, apkfilename[:-4] + "_src.tar.gz") build['vercode'])
for name in [apkpath, srcpath, ascpath]: for repodir in repodirs:
if os.path.exists(name): files = [
logging.warn("Deleting disabled build output " + apkfilename) os.path.join(repodir, apkfilename),
os.remove(name) os.path.join(repodir, apkfilename + '.asc'),
if apkfilename in apkcache: os.path.join(repodir, apkfilename[:-4] + "_src.tar.gz"),
del apkcache[apkfilename] ]
for density in all_screen_densities:
repo_dir = get_icon_dir(repodir, density)
files.append(os.path.join(repo_dir, iconfilename))
for f in files:
if os.path.exists(f):
logging.info("Deleting disabled build output " + f)
os.remove(f)
if apkfilename in apkcache:
del apkcache[apkfilename]
def resize_icon(iconpath, density): def resize_icon(iconpath, density):