Merge branch 'lightmare-fix-write_config'
This commit is contained in:
commit
3dee9b634f
1 changed files with 3 additions and 3 deletions
|
@ -59,11 +59,11 @@ def write_config(env, template_filename, config_filename):
|
||||||
escape = env['ESCAPE']
|
escape = env['ESCAPE']
|
||||||
def subst(matchobj):
|
def subst(matchobj):
|
||||||
key = matchobj.group(1)
|
key = matchobj.group(1)
|
||||||
val = env.get(key)
|
if key not in env:
|
||||||
if val is None:
|
|
||||||
return matchobj.group(0)
|
return matchobj.group(0)
|
||||||
else:
|
else:
|
||||||
return 'CONFIG_%s=%s' % (key, escape(str(val)))
|
val = env.subst('$' + key)
|
||||||
|
return 'CONFIG_%s=%s' % (key, escape(val))
|
||||||
config = re.sub(r'^CONFIG_(\w+)=.*', subst, template, flags=re.M)
|
config = re.sub(r'^CONFIG_(\w+)=.*', subst, template, flags=re.M)
|
||||||
config_file.write(config)
|
config_file.write(config)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue