server: upload "current version" symlinks if requested

If `fdroid update` generates the "current version" symlinks, then
`fdroid server update` should upload them to the server.
This commit is contained in:
Hans-Christoph Steiner 2014-10-10 23:50:27 -04:00
parent b33cae375a
commit 8e9e17892d

View file

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys import sys
import glob
import hashlib import hashlib
import os import os
import paramiko import paramiko
@ -143,6 +144,16 @@ def update_serverwebroot(serverwebroot, repo_section):
sys.exit(1) sys.exit(1)
if subprocess.call(rsyncargs + [indexjar, sectionpath]) != 0: if subprocess.call(rsyncargs + [indexjar, sectionpath]) != 0:
sys.exit(1) 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): def _local_sync(fromdir, todir):