- fix koji mock-config to use sensible defaults for **opts
- add --topurl option to koji mock-config - upload in 64k chunks in incrementalUpload - best-effort to check when mock has truncated a file and started writing from 0 in BuildRoot.mock() - improvements to cmdline parsing in koji call
This commit is contained in:
parent
f71a80d167
commit
e96a8687a0
4 changed files with 67 additions and 50 deletions
29
cli/koji
29
cli/koji
|
|
@ -708,14 +708,25 @@ def handle_call(options, session, args):
|
|||
name = args[0]
|
||||
non_kw = []
|
||||
kw = {}
|
||||
for arg in args[1:]:
|
||||
if arg.isdigit():
|
||||
non_kw.append(int(arg))
|
||||
elif arg.find('=') != -1:
|
||||
key, value = arg.split('=', 1)
|
||||
kw[key] = value
|
||||
|
||||
def _convarg(val):
|
||||
valmap = {'None': None,
|
||||
'True': True,
|
||||
'False': False}
|
||||
|
||||
if val.isdigit():
|
||||
return int(val)
|
||||
elif valmap.has_key(val):
|
||||
return valmap[val]
|
||||
else:
|
||||
non_kw.append(arg)
|
||||
return val
|
||||
|
||||
for arg in args[1:]:
|
||||
if arg.find('=') != -1:
|
||||
key, value = arg.split('=', 1)
|
||||
kw[key] = _convarg(value)
|
||||
else:
|
||||
non_kw.append(_convarg(arg))
|
||||
pprint.pprint(getattr(session, name).__call__(*non_kw, **kw))
|
||||
|
||||
def anon_handle_mock_config(options, session, args):
|
||||
|
|
@ -731,6 +742,8 @@ def anon_handle_mock_config(options, session, args):
|
|||
help=_("Specify mockdir"))
|
||||
parser.add_option("--topdir", metavar="DIR",
|
||||
help=_("Specify topdir"))
|
||||
parser.add_option("--topurl", metavar="URL",
|
||||
help=_("url under which Koji files are accessible"))
|
||||
parser.add_option("--distribution", default="Koji Testing",
|
||||
help=_("Change the distribution macro"))
|
||||
parser.add_option("-o", metavar="FILE", dest="ofile", help=_("Output to a file"))
|
||||
|
|
@ -742,7 +755,7 @@ def anon_handle_mock_config(options, session, args):
|
|||
name = args[0]
|
||||
arch = None
|
||||
opts = {}
|
||||
for k in ('topdir', 'distribution', 'mockdir'):
|
||||
for k in ('topdir', 'topurl', 'distribution', 'mockdir'):
|
||||
if hasattr(options, k):
|
||||
opts[k] = getattr(options, k)
|
||||
if options.buildroot:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue