debuginfo and source options for regen-repo command

This commit is contained in:
Mike McLean 2012-10-16 16:59:28 -04:00
parent 342cd274e6
commit d2dc1a1fd0

View file

@ -5597,6 +5597,8 @@ def handle_regen_repo(options, session, args):
parser = OptionParser(usage=usage)
parser.add_option("--target", action="store_true", help=_("Interpret the argument as a build target name"))
parser.add_option("--nowait", action="store_true", help=_("Don't wait on for regen to finish"))
parser.add_option("--debuginfo", action="store_true", help=_("Include debuginfo rpms in repo"))
parser.add_option("--source", "--src", action="store_true", help=_("Include source rpms in the repo"))
(suboptions, args) = parser.parse_args(args)
if len(args) == 0:
parser.error(_("A tag name must be specified"))
@ -5609,6 +5611,7 @@ def handle_regen_repo(options, session, args):
assert False
activate_session(session)
tag = args[0]
repo_opts = {}
if suboptions.target:
info = session.getBuildTarget(tag)
if not info:
@ -5627,7 +5630,11 @@ def handle_regen_repo(options, session, args):
print "Warning: %s is not a build tag" % tag
if not info['arches']:
print "Warning: tag %s has an empty arch list" % info['name']
task_id = session.newRepo(tag)
if suboptions.debuginfo:
repo_opts['debuginfo'] = True
if suboptions.source:
repo_opts['src'] = True
task_id = session.newRepo(tag, **repo_opts)
print "Regenerating repo for tag " + tag
if _running_in_bg() or suboptions.nowait:
return