Merge branch 'master' into mead
This commit is contained in:
commit
bd0af58ba2
6 changed files with 68 additions and 42 deletions
33
cli/koji
33
cli/koji
|
|
@ -2430,6 +2430,9 @@ def anon_handle_list_pkgs(options, session, args):
|
|||
parser.add_option("--noinherit", action="store_true", help=_("Don't follow inheritance"))
|
||||
parser.add_option("--show-blocked", action="store_true", help=_("Show blocked packages"))
|
||||
parser.add_option("--show-dups", action="store_true", help=_("Show superseded owners"))
|
||||
parser.add_option("--event", type='int', metavar="EVENT#", help=_("query at event"))
|
||||
parser.add_option("--ts", type='int', metavar="TIMESTAMP", help=_("query at timestamp"))
|
||||
parser.add_option("--repo", type='int', metavar="REPO#", help=_("query at event for a repo"))
|
||||
(options, args) = parser.parse_args(args)
|
||||
if len(args) != 0:
|
||||
parser.error(_("This command takes no arguments"))
|
||||
|
|
@ -2460,6 +2463,11 @@ def anon_handle_list_pkgs(options, session, args):
|
|||
opts['with_dups'] = options.show_dups
|
||||
else:
|
||||
opts['with_dups'] = True
|
||||
event = koji.util.eventFromOpts(session, options)
|
||||
if event:
|
||||
opts['event'] = event['id']
|
||||
event['timestr'] = time.asctime(time.localtime(event['ts']))
|
||||
print "Querying at event %(id)i (%(timestr)s)" % event
|
||||
data = session.listPackages(**opts)
|
||||
if not data:
|
||||
print "(no matching packages)"
|
||||
|
|
@ -3031,19 +3039,31 @@ def anon_handle_list_tag_inheritance(options, session, args):
|
|||
parser.add_option("--reverse", action="store_true", help=_("Process tag's children instead of its parents"))
|
||||
parser.add_option("--stop", help=_("Stop processing inheritance at this tag"))
|
||||
parser.add_option("--jump", help=_("Jump from one tag to another when processing inheritance"))
|
||||
parser.add_option("--event", type='int', metavar="EVENT#", help=_("query at event"))
|
||||
parser.add_option("--ts", type='int', metavar="TIMESTAMP", help=_("query at timestamp"))
|
||||
parser.add_option("--repo", type='int', metavar="REPO#", help=_("query at event for a repo"))
|
||||
(options, args) = parser.parse_args(args)
|
||||
if len(args) != 1:
|
||||
parser.error(_("This command takes exctly one argument: a tag name or ID"))
|
||||
assert False
|
||||
activate_session(session)
|
||||
tag = session.getTag(args[0])
|
||||
event = koji.util.eventFromOpts(session, options)
|
||||
if event:
|
||||
event['timestr'] = time.asctime(time.localtime(event['ts']))
|
||||
print "Querying at event %(id)i (%(timestr)s)" % event
|
||||
if event:
|
||||
tag = session.getTag(args[0], event=event['id'])
|
||||
else:
|
||||
tag = session.getTag(args[0])
|
||||
if not tag:
|
||||
parser.error(_("Unknown tag: %s" % args[0]))
|
||||
|
||||
opts = {}
|
||||
opts['reverse'] = options.reverse or False
|
||||
opts['stop'] = {}
|
||||
opts['jump'] = {}
|
||||
opts['stops'] = {}
|
||||
opts['jumps'] = {}
|
||||
if event:
|
||||
opts['event'] = event['id']
|
||||
|
||||
if options.jump:
|
||||
match = re.match(r'^(.*)/(.*)$', options.jump)
|
||||
|
|
@ -3054,16 +3074,17 @@ def anon_handle_list_tag_inheritance(options, session, args):
|
|||
tag2 = session.getTagID(match.group(2))
|
||||
if not tag2:
|
||||
parser.error(_("Unknown tag: %s" % match.group(2)))
|
||||
opts['jump'][str(tag1)] = tag2
|
||||
opts['jumps'][str(tag1)] = tag2
|
||||
|
||||
if options.stop:
|
||||
tag1 = session.getTagID(options.stop)
|
||||
if not tag1:
|
||||
parser.error(_("Unknown tag: %s" % options.stop))
|
||||
opts['stop'] = {str(tag1): 1}
|
||||
opts['stops'] = {str(tag1): 1}
|
||||
|
||||
sys.stdout.write('%s (%i)\n' % (tag['name'], tag['id']))
|
||||
_printInheritance(session.getFullInheritance(tag['id'], None, opts['reverse'], opts['stop'], opts['jump']), None, opts['reverse'])
|
||||
data = session.getFullInheritance(tag['id'], **opts)
|
||||
_printInheritance(data, None, opts['reverse'])
|
||||
|
||||
def anon_handle_list_tags(options, session, args):
|
||||
"Print the list of tags"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue