From 0c4db061d4be272fc7693fe21e2566c33cec7b13 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Feb 02 2021 13:45:35 +0000 Subject: PR#2608: cli: support download-build --type=remote-sources Merges #2608 https://pagure.io/koji/pull-request/2608 Fixes #2611 https://pagure.io/koji/issue/2611 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index a03a4c8..8cb0e14 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -6754,7 +6754,7 @@ def anon_handle_download_build(options, session, args): help=_("Only download packages for this arch (may be used multiple times)")) parser.add_option("--type", help=_("Download archives of the given type, rather than rpms " - "(maven, win, or image)")) + "(maven, win, image, remote-source)")) parser.add_option("--latestfrom", dest="latestfrom", help=_("Download the latest build from this tag")) parser.add_option("--debuginfo", action="store_true", help=_("Also download -debuginfo rpms")) diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py index 782597a..4c0531f 100644 --- a/cli/koji_cli/lib.py +++ b/cli/koji_cli/lib.py @@ -653,6 +653,10 @@ def download_archive(build, archive, topurl, quiet=False, noprogress=False): elif archive['btype'] == 'image': url = os.path.join(pi.imagebuild(build), archive['filename']) path = archive['filename'] + elif archive['btype'] == 'remote-sources': + directory = pi.typedir(build, 'remote-sources') + url = os.path.join(directory, archive['filename']) + path = archive['filename'] else: # TODO: cover module/operator-manifests/remote-sources raise NotImplementedError(archive['btype'])