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
This commit is contained in:
Tomas Kopecek 2021-02-02 14:45:35 +01:00
commit 0c4db061d4
2 changed files with 5 additions and 1 deletions

View file

@ -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"))

View file

@ -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'])