Merge commit 'origin' into mead
This commit is contained in:
commit
74336acf97
1 changed files with 20 additions and 2 deletions
22
cli/koji
22
cli/koji
|
|
@ -3943,11 +3943,12 @@ def handle_unblock_pkg(options, session, args):
|
|||
|
||||
def anon_handle_download_build(options, session, args):
|
||||
"Download a built package"
|
||||
usage = _("usage: %prog download-build [options] <n-v-r | build_id>")
|
||||
usage = _("usage: %prog download-build [options] <n-v-r | build_id | package>")
|
||||
usage += _("\n(Specify the --help global option for a list of other help options)")
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option("--arch", dest="arches", metavar="ARCH", action="append", default=[],
|
||||
help=_("Only download packages for this arch (may be used multiple times)"))
|
||||
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"))
|
||||
parser.add_option("-q", "--quiet", action="store_true", help=_("Do not display progress meter"))
|
||||
(suboptions, args) = parser.parse_args(args)
|
||||
|
|
@ -3962,8 +3963,25 @@ def anon_handle_download_build(options, session, args):
|
|||
build = args[0]
|
||||
|
||||
if build.isdigit():
|
||||
if suboptions.latestfrom:
|
||||
print "--latestfrom not compatible with build IDs, specify a package name."
|
||||
return 1
|
||||
build = int(build)
|
||||
info = session.getBuild(build)
|
||||
|
||||
if suboptions.latestfrom:
|
||||
# We want the latest build, not a specific build
|
||||
try:
|
||||
builds = session.listTagged(suboptions.latestfrom, latest=True, package=build)
|
||||
except koji.GenericError, data:
|
||||
print "Error finding latest build: %s" % data
|
||||
return 1
|
||||
if not builds:
|
||||
print "%s has no builds of %s" % (suboptions.latestfrom, build)
|
||||
return 1
|
||||
info = builds[0]
|
||||
else:
|
||||
info = session.getBuild(build)
|
||||
|
||||
if info is None:
|
||||
print "No such build: %s" % build
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue