chiark / gitweb /
Remove already built disabled builds from repo
authorCiaran Gultnieks <ciaran@ciarang.com>
Thu, 20 Sep 2012 13:14:18 +0000 (14:14 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Thu, 20 Sep 2012 13:14:18 +0000 (14:14 +0100)
fdroidserver/update.py

index a7dceaaf400fde6a67509e76dc2e37a642dc1907..ac8fc2c841da88021ec8a9cd0a8e4e4475789b69 100644 (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')):