- build.set_flag(k, v)
- else:
- keyflagtype = flagtype(k)
-
- if keyflagtype == 'script':
- build.set_flag(k, re.sub(esc_newlines, '', v).lstrip().rstrip())
- elif keyflagtype == 'bool':
- # TODO handle this using <xsd:element type="xsd:boolean> in a schema
- if isinstance(v, basestring) and v == 'true':
- build.set_flag(k, 'true')
- elif keyflagtype == 'string':
- if isinstance(v, bool) and v:
- build.set_flag(k, 'yes')
+ build.set_flag(k, str(v))
+ continue
+
+ ftype = flagtype(k)
+
+ if ftype == 'script':
+ build.set_flag(k, re.sub(esc_newlines, '', v).lstrip().rstrip())
+ elif ftype == 'bool':
+ # TODO handle this using <xsd:element type="xsd:boolean> in a schema
+ if isinstance(v, basestring) and v == 'true':
+ build.set_flag(k, True)
+ elif ftype == 'string':
+ if isinstance(v, bool) and v:
+ build.set_flag(k, 'yes')