allow debuginfo for sidetag repos
Fixes: https://pagure.io/koji/issue/540
This commit is contained in:
parent
b972b572a0
commit
2a621b337c
3 changed files with 19 additions and 8 deletions
|
|
@ -5341,7 +5341,8 @@ class NewRepoTask(BaseTaskHandler):
|
|||
kwargs['with_src'] = True
|
||||
if separate_src:
|
||||
kwargs['with_separate_src'] = True
|
||||
if debuginfo:
|
||||
# generate debuginfo repo if requested or if specified in sidetag's extra
|
||||
if debuginfo or tinfo['extra'].get('with_debuginfo'):
|
||||
kwargs['with_debuginfo'] = True
|
||||
repo_id, event_id = self.session.host.repoInit(tinfo['id'], **kwargs)
|
||||
path = koji.pathinfo.repo(repo_id, tinfo['name'])
|
||||
|
|
|
|||
|
|
@ -30,12 +30,16 @@ def handle_add_sidetag(options, session, args):
|
|||
parser.add_argument(
|
||||
"-w", "--wait", action="store_true", help=_("Wait until repo is ready.")
|
||||
)
|
||||
parser.add_argument(
|
||||
"--debuginfo", action="store_true", help=_("Buildroot repo will contain debuginfos")
|
||||
)
|
||||
|
||||
opts = parser.parse_args(args)
|
||||
|
||||
activate_session(session, options)
|
||||
|
||||
try:
|
||||
tag = session.createSideTag(opts.basetag)
|
||||
tag = session.createSideTag(opts.basetag, debuginfo=opts.debuginfo)
|
||||
except koji.ActionNotAllowed:
|
||||
parser.error(_("Policy violation"))
|
||||
|
||||
|
|
|
|||
|
|
@ -25,11 +25,14 @@ CONFIG = None
|
|||
|
||||
|
||||
@export
|
||||
def createSideTag(basetag):
|
||||
def createSideTag(basetag, debuginfo=False):
|
||||
"""Create a side tag.
|
||||
|
||||
:param basetag: name or ID of base tag
|
||||
:type basetag: str or int
|
||||
|
||||
:param debuginfo: should buildroot repos contain debuginfo?
|
||||
:tybe debuginfo: bool
|
||||
"""
|
||||
|
||||
# Any logged-in user is able to request creation of side tags,
|
||||
|
|
@ -61,15 +64,18 @@ def createSideTag(basetag):
|
|||
# id assigned by _create_tag
|
||||
tag_id = nextval("tag_id_seq") + 1
|
||||
sidetag_name = "%s-side-%s" % (basetag["name"], tag_id)
|
||||
extra = {
|
||||
"sidetag": True,
|
||||
"sidetag_user": user["name"],
|
||||
"sidetag_user_id": user["id"],
|
||||
}
|
||||
if debuginfo:
|
||||
extra['with_debuginfo'] = True
|
||||
sidetag_id = _create_tag(
|
||||
sidetag_name,
|
||||
parent=basetag["id"],
|
||||
arches=basetag["arches"],
|
||||
extra={
|
||||
"sidetag": True,
|
||||
"sidetag_user": user["name"],
|
||||
"sidetag_user_id": user["id"],
|
||||
},
|
||||
extra=extra,
|
||||
)
|
||||
_create_build_target(sidetag_name, sidetag_id, sidetag_id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue