chiark / gitweb /
when symlinking current version of app, include gpg sig if it exists
authorHans-Christoph Steiner <hans@eds.org>
Sat, 11 Oct 2014 00:54:32 +0000 (20:54 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 11 Nov 2014 14:06:52 +0000 (15:06 +0100)
Let's make it easy for people to also find the GPG signature, and promote
easy verification!

fdroidserver/update.py

index cd59a656956a51eb979665fa1e821a0d85508d25..b96d860ef4cc0de06d9fde0c67ed4927af9c1c05 100644 (file)
@@ -869,9 +869,18 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
                 and config['make_current_version_link'] \
                 and repodir == 'repo':  # only create these
             apklinkname = app[config['current_version_name_source']] + '.apk'
+            current_version_path = os.path.join(repodir, current_version_file)
             if os.path.exists(apklinkname):
                 os.remove(apklinkname)
-            os.symlink(os.path.join(repodir, current_version_file), apklinkname)
+            os.symlink(current_version_path, apklinkname)
+            # also symlink gpg signature, if it exists
+            for extension in ('.asc', '.sig'):
+                sigfile_path = current_version_path + extension
+                if os.path.exists(sigfile_path):
+                    siglinkname = apklinkname + extension
+                    if os.path.exists(siglinkname):
+                        os.remove(siglinkname)
+                    os.symlink(sigfile_path, siglinkname)
 
     of = open(os.path.join(repodir, 'index.xml'), 'wb')
     if options.pretty: