implement --event
This commit is contained in:
parent
08259b426e
commit
e611febbcd
3 changed files with 13 additions and 11 deletions
|
|
@ -4929,8 +4929,7 @@ class NewSignedRepoTask(BaseTaskHandler):
|
|||
_taskWeight = 0.1
|
||||
|
||||
def handler(self, tag, repo_id, task_opts):
|
||||
# TODO: remember to use an event here
|
||||
tinfo = self.session.getTag(tag, strict=True)
|
||||
tinfo = self.session.getTag(tag, strict=True, event=task_opts['event'])
|
||||
path = koji.pathinfo.signedrepo(repo_id, tinfo['name'])
|
||||
if not os.path.isdir(path):
|
||||
raise koji.GenericError, "Repo directory missing: %s" % path
|
||||
|
|
@ -4951,7 +4950,7 @@ class NewSignedRepoTask(BaseTaskHandler):
|
|||
data[arch] = results[task_id]
|
||||
self.logger.debug("DEBUG: %r : %r " % (arch, data[arch],))
|
||||
self.session.host.repoDone(repo_id, data, expire=True, signed=True)
|
||||
return repo_id
|
||||
return repo_id, task_opts['event']
|
||||
|
||||
|
||||
class createSignedRepoTask(CreaterepoTask):
|
||||
|
|
|
|||
5
cli/koji
5
cli/koji
|
|
@ -7085,13 +7085,13 @@ def handle_signed_repo(options, session, args):
|
|||
help=_("Indicate an architecture to consider. The default is all " +
|
||||
"architectures associated with the given tag. This option may " +
|
||||
"be specified multiple times."))
|
||||
parser.add_option('--event', type='int',
|
||||
help=_('create a signed repository based on a Brew event'))
|
||||
parser.add_option('--multilib', action='store_true', default=False,
|
||||
help=_('Include multilib packages in the repository'))
|
||||
parser.add_option("--noinherit", action='store_true', default=False,
|
||||
help=_('Do not consider tag inheritance'))
|
||||
# TODO: accept comps
|
||||
# TODO: accept events
|
||||
# TODO: sources or no?
|
||||
# TODO: latest?
|
||||
# TODO: delta-rpms ugh
|
||||
parser.add_option("--nowait", action='store_true', default=False,
|
||||
|
|
@ -7124,6 +7124,7 @@ def handle_signed_repo(options, session, args):
|
|||
pass
|
||||
opts = {
|
||||
'arch': task_opts.arch,
|
||||
'event': task_opts.event,
|
||||
'multilib': task_opts.multilib,
|
||||
'inherit': not task_opts.noinherit,
|
||||
'skip': task_opts.skip_unsigned,
|
||||
|
|
|
|||
|
|
@ -2454,13 +2454,15 @@ def signed_repo_init(tag, keys, task_opts):
|
|||
for arch in repo_arches:
|
||||
arches.add(koji.canonArch(arch))
|
||||
repo_id = _singleValue("SELECT nextval('repo_id_seq')")
|
||||
event_id = _singleValue("SELECT get_event()")
|
||||
if not task_opts['event']:
|
||||
task_opts['event'] = _singleValue("SELECT get_event()")
|
||||
insert = InsertProcessor('repo')
|
||||
insert.set(id=repo_id, create_event=event_id, tag_id=tag_id, state=state)
|
||||
insert.set(id=repo_id, create_event=task_opts['event'], tag_id=tag_id,
|
||||
state=state)
|
||||
insert.execute()
|
||||
# Need to pass event_id because even though this is a single transaction,
|
||||
# it is possible to see the results of other committed transactions
|
||||
rpm_iter, builds = readTaggedRPMS(tag_id, event=event_id,
|
||||
rpm_iter, builds = readTaggedRPMS(tag_id, event=task_opts['event'],
|
||||
inherit=task_opts['inherit'], rpmsigs=True)
|
||||
rpms = list(rpm_iter)
|
||||
for rpm_copy in list(rpms):
|
||||
|
|
@ -2535,9 +2537,9 @@ def signed_repo_init(tag, keys, task_opts):
|
|||
missing.sort()
|
||||
raise koji.GenericError('Unsigned packages found: ' +
|
||||
'\n'.join(missing))
|
||||
koji.plugin.run_callbacks('postRepoInit', tag=tinfo, event=event_id,
|
||||
repo_id=repo_id)
|
||||
return repo_id, event_id
|
||||
koji.plugin.run_callbacks('postRepoInit', tag=tinfo,
|
||||
event=task_opts['event'], repo_id=repo_id)
|
||||
return repo_id, task_opts['event']
|
||||
|
||||
|
||||
def repo_set_state(repo_id, state, check=True):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue