chiark / gitweb /
server: upload "current version" symlinks if requested
authorHans-Christoph Steiner <hans@eds.org>
Sat, 11 Oct 2014 03:50:27 +0000 (23:50 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 11 Nov 2014 14:06:53 +0000 (15:06 +0100)
If `fdroid update` generates the "current version" symlinks, then
`fdroid server update` should upload them to the server.

fdroidserver/server.py

index e0217836a824b0338a6796bea6008b705a0b0184..a9a04ecd444048240436d93406be6b0753db49ab 100644 (file)
@@ -18,6 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import sys
+import glob
 import hashlib
 import os
 import paramiko
@@ -143,6 +144,16 @@ def update_serverwebroot(serverwebroot, repo_section):
         sys.exit(1)
     if subprocess.call(rsyncargs + [indexjar, sectionpath]) != 0:
         sys.exit(1)
+    # upload "current version" symlinks if requested
+    if config['make_current_version_link'] and repo_section == 'repo':
+        links_to_upload = []
+        for f in glob.glob('*.apk') \
+                + glob.glob('*.apk.asc') + glob.glob('*.apk.sig'):
+            if os.path.islink(f):
+                links_to_upload.append(f)
+        if len(links_to_upload) > 0:
+            if subprocess.call(rsyncargs + links_to_upload + [serverwebroot]) != 0:
+                sys.exit(1)
 
 
 def _local_sync(fromdir, todir):