config: convert serverwebroot: to list-of-dicts format

This allows for more metadata about the server and deploy mode.
This commit is contained in:
Hans-Christoph Steiner 2024-01-22 21:58:12 +01:00
parent 3f50372d8d
commit 7a656d45e3
5 changed files with 44 additions and 24 deletions

View file

@ -294,11 +294,12 @@ def update_serverwebroot(serverwebroot, repo_section):
rsyncargs += ['-e', 'ssh -oBatchMode=yes -oIdentitiesOnly=yes -i ' + options.identity_file]
elif 'identity_file' in config:
rsyncargs += ['-e', 'ssh -oBatchMode=yes -oIdentitiesOnly=yes -i ' + config['identity_file']]
logging.info('rsyncing ' + repo_section + ' to ' + serverwebroot)
url = serverwebroot['url']
logging.info('rsyncing ' + repo_section + ' to ' + url)
excludes = _get_index_excludes(repo_section)
if subprocess.call(rsyncargs + excludes + [repo_section, serverwebroot]) != 0:
if subprocess.call(rsyncargs + excludes + [repo_section, url]) != 0:
raise FDroidException()
if subprocess.call(rsyncargs + [repo_section, serverwebroot]) != 0:
if subprocess.call(rsyncargs + [repo_section, url]) != 0:
raise FDroidException()
# upload "current version" symlinks if requested
if config['make_current_version_link'] and repo_section == 'repo':
@ -308,7 +309,7 @@ def update_serverwebroot(serverwebroot, repo_section):
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:
if subprocess.call(rsyncargs + links_to_upload + [url]) != 0:
raise FDroidException()