1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-15 03:20:10 +01:00

feat: add --index-only flag

This commit is contained in:
proletarius101 2023-12-10 22:17:28 +00:00 committed by Hans-Christoph Steiner
parent 24b3b0957f
commit 7a5ecd0c6d
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