verbose option for list-buildroot command

This commit is contained in:
Mike McLean 2011-09-09 13:23:18 -04:00
parent 8b53132884
commit b54ca80623

View file

@ -2466,6 +2466,7 @@ def anon_handle_list_buildroot(options, session, args):
parser = OptionParser(usage=usage)
parser.add_option("--paths", action="store_true", help=_("Show the file paths"))
parser.add_option("--built", action="store_true", help=_("Show the built rpms"))
parser.add_option("--verbose", "-v", action="store_true", help=_("Show more information"))
(options, args) = parser.parse_args(args)
if len(args) != 1:
parser.error(_("Incorrect number of arguments"))
@ -2480,10 +2481,13 @@ def anon_handle_list_buildroot(options, session, args):
data = session.listRPMs(**opts)
fmt = "%(nvr)s.%(arch)s"
output = [ fmt % x for x in data]
output.sort()
for line in output:
print line
order = [(fmt % x, x) for x in data]
order.sort()
for nvra, rinfo in order:
if options.verbose and rinfo.get('is_update'):
print nvra, "[update]"
else:
print nvra
def anon_handle_list_untagged(options, session, args):
"List untagged builds"