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

feat: add --index-only flag

This commit is contained in:
proletarius101 2023-12-10 22:17:28 +00:00
parent f50e5a806d
commit 3dee7e915d
No known key found for this signature in database
2 changed files with 15 additions and 16 deletions

View File

@ -264,7 +264,7 @@ __complete_nightly() {
__complete_deploy() { __complete_deploy() {
opts="-i -v -q" opts="-i -v -q"
lopts="--identity-file --local-copy-dir --sync-from-local-copy-dir lopts="--identity-file --local-copy-dir --sync-from-local-copy-dir
--verbose --quiet --no-checksum --no-keep-git-mirror-archive" --verbose --quiet --no-checksum --no-keep-git-mirror-archive --index-only"
__complete_options __complete_options
} }

View File

@ -49,6 +49,7 @@ USER_RCLONE_CONF = None
REMOTE_HOSTNAME_REGEX = re.compile(r'\W*\w+\W+(\w+).*') REMOTE_HOSTNAME_REGEX = re.compile(r'\W*\w+\W+(\w+).*')
INDEX_FILES = [ INDEX_FILES = [
"altstore-index.json",
"entry.jar", "entry.jar",
"entry.json", "entry.json",
"entry.json.asc", "entry.json.asc",
@ -62,6 +63,10 @@ INDEX_FILES = [
] ]
def _get_index_file_paths(repo_section):
return [os.path.join(repo_section, filename) for filename in INDEX_FILES]
def _get_index_excludes(repo_section): def _get_index_excludes(repo_section):
"""Return the list of files to be synced last, since they finalize the deploy. """Return the list of files to be synced last, since they finalize the deploy.
@ -71,19 +76,7 @@ def _get_index_excludes(repo_section):
client learns about them from the new index files. client learns about them from the new index files.
""" """
indexes = [ indexes = _get_index_file_paths(repo_section)
os.path.join(repo_section, 'altstore-index.json'),
os.path.join(repo_section, 'entry.jar'),
os.path.join(repo_section, 'entry.json'),
os.path.join(repo_section, 'entry.json.asc'),
os.path.join(repo_section, 'index-v1.jar'),
os.path.join(repo_section, 'index-v1.json'),
os.path.join(repo_section, 'index-v1.json.asc'),
os.path.join(repo_section, 'index-v2.json'),
os.path.join(repo_section, 'index-v2.json.asc'),
os.path.join(repo_section, 'index.jar'),
os.path.join(repo_section, 'index.xml'),
]
index_excludes = [] index_excludes = []
for f in indexes: for f in indexes:
index_excludes.append('--exclude') index_excludes.append('--exclude')
@ -1025,8 +1018,14 @@ def main():
default=False, default=False,
help=_("If a git mirror gets to big, allow the archive to be deleted"), help=_("If a git mirror gets to big, allow the archive to be deleted"),
) )
options = common.parse_args(parser) parser.add_argument(
config = common.read_config() "--index-only",
action="store_true",
default=False,
help="Only deploy the index files entry.* and index-v*.json",
)
options = parser.parse_args()
config = common.read_config(options)
if config.get('nonstandardwebroot') is True: if config.get('nonstandardwebroot') is True:
standardwebroot = False standardwebroot = False