chiark / gitweb /
only move GPG signature if APK exists
authorHans-Christoph Steiner <hans@eds.org>
Tue, 1 Jul 2014 01:47:47 +0000 (21:47 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 1 Jul 2014 03:01:48 +0000 (23:01 -0400)
The .asc moving code just needed to be indented so it only runs when
'srcname' exists in apk[], otherwise it just throws a KeyError

fdroidserver/update.py

index 952165b5846aac7000caca2a205813b44319a1f9..18966b46432db4ee39cd1eb0bb1646ebafcffa31 100644 (file)
@@ -876,11 +876,11 @@ def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversi
                 if 'srcname' in apk:
                     shutil.move(os.path.join(repodir, apk['srcname']),
                                 os.path.join(archivedir, apk['srcname']))
-                # Move GPG signature too...
-                sigfile = apk['srcname'] + '.asc'
-                sigsrc = os.path.join(repodir, sigfile)
-                if os.path.exists(sigsrc):
-                    shutil.move(sigsrc, os.path.join(archivedir, sigfile))
+                    # Move GPG signature too...
+                    sigfile = apk['srcname'] + '.asc'
+                    sigsrc = os.path.join(repodir, sigfile)
+                    if os.path.exists(sigsrc):
+                        shutil.move(sigsrc, os.path.join(archivedir, sigfile))
 
                 archapks.append(apk)
                 apks.remove(apk)