From 69a508e762aec8f812d1fa9c0b7813d501731be3 Mon Sep 17 00:00:00 2001 From: proletarius101 Date: Thu, 14 Dec 2023 15:21:53 +0000 Subject: [PATCH] feat(deploy): support --index-only option for serverwebroot deployments --- fdroidserver/deploy.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/fdroidserver/deploy.py b/fdroidserver/deploy.py index e5a46783..0f78ee43 100644 --- a/fdroidserver/deploy.py +++ b/fdroidserver/deploy.py @@ -327,21 +327,23 @@ def update_serverwebroot(serverwebroot, repo_section): rsyncargs += ['-e', 'ssh -oBatchMode=yes -oIdentitiesOnly=yes -i ' + config['identity_file']] url = serverwebroot['url'] logging.info('rsyncing ' + repo_section + ' to ' + url) - excludes = _get_index_excludes(repo_section) - if subprocess.call(rsyncargs + excludes + [repo_section, url]) != 0: - raise FDroidException() - if subprocess.call(rsyncargs + [repo_section, url]) != 0: - raise FDroidException() - # upload "current version" symlinks if requested - if config and config.get('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 + [url]) != 0: - raise FDroidException() + if options.index_only: + if subprocess.call(rsyncargs + ['--excludes', "*"] + _get_index_includes(repo_section) + [repo_section, url]) != 0: + raise FDroidException() + else: + excludes = _get_index_excludes(repo_section) + if subprocess.call(rsyncargs + excludes + [repo_section, url]) != 0: + raise FDroidException() + # 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 + [url]) != 0: + raise FDroidException() def update_serverwebroots(serverwebroots, repo_section, standardwebroot=True):