From 004a1ba45079874e2c4921c74d82ffd35c1d05ca Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Oct 29 2014 03:54:20 +0000 Subject: preserve the format of parameters with no value when calling maven-build and maven-chain -Dfoo and -Dfoo= mean different things to the JVM, so make sure the format of the parameter on the command-line is carried through to the mvn invocation. --- diff --git a/builder/kojid b/builder/kojid index b469b66..21f2d99 100755 --- a/builder/kojid +++ b/builder/kojid @@ -579,7 +579,7 @@ class BuildRoot(object): cmd.append('-P%s' % ','.join(profiles)) if props: for name, value in props.items(): - if value: + if value is not None: cmd.append('-D%s=%s' % (name, value)) else: cmd.append('-D%s' % name) diff --git a/cli/koji b/cli/koji index 1379518..02f7005 100755 --- a/cli/koji +++ b/cli/koji @@ -1114,7 +1114,7 @@ def handle_maven_build(options, session, args): for prop in build_opts.properties: fields = prop.split('=', 1) if len(fields) != 2: - fields.append('') + fields.append(None) props[fields[0]] = fields[1] if props: opts['properties'] = props @@ -1199,7 +1199,7 @@ def _maven_params(parser, opts, items): for prop in value.splitlines(): fields = prop.split('=', 1) if len(fields) != 2: - fields.append('') + fields.append(None) props[fields[0]] = fields[1] value = props elif name == 'envs': diff --git a/www/kojiweb/taskinfo.chtml b/www/kojiweb/taskinfo.chtml index 218ecb9..3760bc0 100644 --- a/www/kojiweb/taskinfo.chtml +++ b/www/kojiweb/taskinfo.chtml @@ -15,9 +15,15 @@ $value #end if #end def +#def printProperties($props) + #echo ', '.join([$v is not None and '%s=%s' % ($n, $v) or $str($n) for $n, $v in $props.items()]) +#end def + #def printMap($vals, $prefix='') #for $key, $value in $vals.items() - #if $key != '__starstar' + #if $key == 'properties' + ${prefix}properties = $printProperties($value) + #elif $key != '__starstar' $prefix$key = $printValue($key, $value)
#end if #end for