diff --git a/completion/bash-completion b/completion/bash-completion index 780509db..4a54954d 100644 --- a/completion/bash-completion +++ b/completion/bash-completion @@ -253,7 +253,7 @@ __complete_btlog() { __complete_mirror() { opts="-v" - lopts="--archive --output-dir" + lopts="--all --archive --build-logs --pgp-signatures --src-tarballs --output-dir" __complete_options } diff --git a/fdroidserver/mirror.py b/fdroidserver/mirror.py index 920c9acf..2510e3d0 100644 --- a/fdroidserver/mirror.py +++ b/fdroidserver/mirror.py @@ -46,16 +46,26 @@ def main(): parser.add_argument("url", nargs='?', help=_('Base URL to mirror, can include the index signing key ' + 'using the query string: ?fingerprint=')) + parser.add_argument("--all", action='store_true', default=False, + help=_("Mirror the full repo and archive, all file types.")) parser.add_argument("--archive", action='store_true', default=False, help=_("Also mirror the full archive section")) parser.add_argument("--build-logs", action='store_true', default=False, help=_("Include the build logs in the mirror")) + parser.add_argument("--pgp-signatures", action='store_true', default=False, + help=_("Include the PGP signature .asc files in the mirror")) parser.add_argument("--src-tarballs", action='store_true', default=False, help=_("Include the source tarballs in the mirror")) parser.add_argument("--output-dir", default=None, help=_("The directory to write the mirror to")) options = parser.parse_args() + if options.all: + options.archive = True + options.build_logs = True + options.pgp_signatures = True + options.src_tarballs = True + if options.url is None: logging.error(_('A URL is required as an argument!') + '\n') parser.print_help() @@ -152,7 +162,8 @@ def main(): if not os.path.exists(f) \ or (f.endswith('.apk') and os.path.getsize(f) != package['size']): urls.append(_append_to_url_path(section, f)) - urls.append(_append_to_url_path(section, f + '.asc')) + if options.pgp_signatures: + urls.append(_append_to_url_path(section, f + '.asc')) if options.build_logs and f.endswith('.apk'): urls.append(_append_to_url_path(section, f[:-4] + '.log.gz'))