move package addition logic to builder from hub

This commit is contained in:
Jay Greguske 2016-01-27 10:22:47 -05:00 committed by Mike McLean
parent e0e1dc15ee
commit 8f638935b6
5 changed files with 198 additions and 134 deletions

View file

@ -7088,14 +7088,13 @@ def handle_signed_repo(options, session, args):
parser.add_option('--comps', help='Include a comps file in the repodata')
parser.add_option('--delta-rpms', metavar='PATH',default=[],
action='append',
help=_('Create delta-rpms. PATH points to (older) rpms to generate against. May be specified multiple times.'))
help=_('Create delta-rpms. PATH points to (older) rpms to generate against. May be specified multiple times. These have to be reachable by the builder too, so the path needs to reach shared storage.'))
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('--multilib', action='store_true', default=None,
help=_('Include multilib packages in the repository using a config'))
parser.add_option("--noinherit", action='store_true', default=False,
help=_('Do not consider tag inheritance'))
# TODO: latest?
parser.add_option("--nowait", action='store_true', default=False,
help=_('Do not wait for the task to complete'))
parser.add_option('--skip-unsigned', action='store_true', default=False,
@ -7106,13 +7105,27 @@ def handle_signed_repo(options, session, args):
if task_opts.allow_unsigned and task_opts.skip_unsigned:
parser.error(_('allow_signed and skip_unsigned are mutually exclusive'))
activate_session(session)
stuffdir = _unique_path('cli-signed')
if task_opts.comps:
if not os.path.exists(task_opts.comps):
parser.error(_('could not find %s' % task_opts.comps))
compsdir = _unique_path('cli-signed')
session.uploadWrapper(task_opts.comps, compsdir,
session.uploadWrapper(task_opts.comps, stuffdir,
callback=_progress_callback)
task_opts.comps = os.path.join(compsdir, os.path.basename(task_opts.comps))
task_opts.comps = os.path.join(stuffdir,
os.path.basename(task_opts.comps))
if len(task_opts.delta_rpms) > 0:
for path in task_opts.delta_rpms:
if not os.path.exists(path):
print _("Warning: %s is not reachable locally. If this" % path)
print _(" host does not have access to Koji's shared storage")
print _(" this can be ignored.")
if task_opts.multilib:
if not os.path.exists(task_opts.multilib):
parser.error(_('could not find %s' % task_opts.multilib))
session.uploadWrapper(task_opts.multilib, stuffdir,
callback=_progress_callback)
task_opts.comps = os.path.join(stuffdir,
os.path.basename(task_opts.multilib))
tag = args[0]
keys = args[1:]
taginfo = session.getTag(tag)