1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-21 04:10:37 +02:00

feat(deploy): support --index-only option for serverwebroot deployments

This commit is contained in:
proletarius101 2023-12-14 15:21:53 +00:00
parent 2c361f6cee
commit bd62007b54
No known key found for this signature in database

View File

@ -498,20 +498,24 @@ def update_serverwebroot(serverwebroot, repo_section):
] ]
url = serverwebroot['url'] url = serverwebroot['url']
logging.info('rsyncing ' + repo_section + ' to ' + url) logging.info('rsyncing ' + repo_section + ' to ' + url)
excludes = _get_index_excludes(repo_section) if options.index_only:
if subprocess.call(rsyncargs + excludes + [repo_section, url]) != 0: if subprocess.call(rsyncargs + ['--excludes', "*"] + _get_index_includes(repo_section) + [repo_section, url]) != 0:
raise FDroidException() raise FDroidException()
if subprocess.call(rsyncargs + [repo_section, url]) != 0: else:
raise FDroidException() excludes = _get_index_excludes(repo_section)
# upload "current version" symlinks if requested if subprocess.call(rsyncargs + excludes + [repo_section, url]) != 0:
if config and config.get('make_current_version_link') and repo_section == 'repo': raise FDroidException()
links_to_upload = [] if subprocess.call(rsyncargs + [repo_section, url]) != 0:
for f in glob.glob('*.apk') + glob.glob('*.apk.asc') + glob.glob('*.apk.sig'): raise FDroidException()
if os.path.islink(f): # upload "current version" symlinks if requested
links_to_upload.append(f) if config and config.get('make_current_version_link') and repo_section == 'repo':
if len(links_to_upload) > 0: links_to_upload = []
if subprocess.call(rsyncargs + links_to_upload + [url]) != 0: for f in glob.glob('*.apk') + glob.glob('*.apk.asc') + glob.glob('*.apk.sig'):
raise FDroidException() 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): def update_serverwebroots(serverwebroots, repo_section, standardwebroot=True):