genconfig.py: only use CONFIG.local
Everything we need is in CONFIG.local - so just use that file. This allows us to remove the for loop as well. CONFIG.local is currently a symlink to mk/config.mk - that will be changed in the patch that removes the symlink. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ia7f84eac85d322f2873f089ab62c99a69c4d9ef9 Reviewed-on: https://review.gerrithub.io/429947 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: GangCao <gang.cao@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
b237c1b5c3
commit
840b922551
@ -16,29 +16,28 @@ for arg in sys.argv:
|
|||||||
args[var] = val
|
args[var] = val
|
||||||
|
|
||||||
defs = {}
|
defs = {}
|
||||||
for config in ('CONFIG', 'CONFIG.local'):
|
try:
|
||||||
try:
|
with open("CONFIG.local") as f:
|
||||||
with open(config) as f:
|
for line in f:
|
||||||
for line in f:
|
line = line.strip()
|
||||||
line = line.strip()
|
if not comment.match(line):
|
||||||
if not comment.match(line):
|
m = assign.match(line)
|
||||||
m = assign.match(line)
|
if m:
|
||||||
if m:
|
var = m.group(1).strip()
|
||||||
var = m.group(1).strip()
|
default = m.group(3).strip()
|
||||||
default = m.group(3).strip()
|
val = default
|
||||||
val = default
|
if var in args:
|
||||||
if var in args:
|
val = args[var]
|
||||||
val = args[var]
|
if default.lower() == 'y' or default.lower() == 'n':
|
||||||
if default.lower() == 'y' or default.lower() == 'n':
|
if val.lower() == 'y':
|
||||||
if val.lower() == 'y':
|
defs["SPDK_{0}".format(var)] = 1
|
||||||
defs["SPDK_{0}".format(var)] = 1
|
|
||||||
else:
|
|
||||||
defs["SPDK_{0}".format(var)] = 0
|
|
||||||
else:
|
else:
|
||||||
strval = val.replace('"', '\"')
|
defs["SPDK_{0}".format(var)] = 0
|
||||||
defs["SPDK_{0}".format(var)] = strval
|
else:
|
||||||
except IOError:
|
strval = val.replace('"', '\"')
|
||||||
continue
|
defs["SPDK_{0}".format(var)] = strval
|
||||||
|
except IOError:
|
||||||
|
print("CONFIG.local not found")
|
||||||
|
|
||||||
for key, value in sorted(defs.items()):
|
for key, value in sorted(defs.items()):
|
||||||
if value == 0:
|
if value == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user