Remove already built disabled builds from repo

This commit is contained in:
Ciaran Gultnieks 2012-09-20 14:14:18 +01:00
parent bbfb472fe5
commit b321e26a65

View file

@ -235,6 +235,21 @@ def main():
else:
apkcache = {}
cachechanged = False
# Check repo directory for disabled builds and remove them...
for app in apps:
for build in app['builds']:
if build['commit'].startswith('!'):
apkfilename = app['id'] + '_' + str(build['vercode']) + '.apk'
apkpath = os.path.join('repo', apkfilename)
srcpath = apkfilename[:-4] + "_src.tar.gz"
for name in [apkpath, srcpath]:
if os.path.exists(name):
print "Deleting disabled build output " + apkfilename
os.remove(name)
if apkcache.has_key(apkfilename):
del apkcache[apkfilename]
apks = []
for apkfile in glob.glob(os.path.join('repo','*.apk')):