./configure script should only show blocks (and associated comments) where it is not default
This commit is contained in:
parent
f77bfb7336
commit
00f98e6810
2 changed files with 19 additions and 4 deletions
|
@ -164,6 +164,7 @@ changelog-seen = 2
|
||||||
# General build configuration options
|
# General build configuration options
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
[build]
|
[build]
|
||||||
|
|
||||||
# The default stage to use for the `check` subcommand
|
# The default stage to use for the `check` subcommand
|
||||||
#check-stage = 0
|
#check-stage = 0
|
||||||
|
|
||||||
|
|
|
@ -486,6 +486,22 @@ for section_key, section_config in config.items():
|
||||||
else:
|
else:
|
||||||
configure_section(sections[section_key], section_config)
|
configure_section(sections[section_key], section_config)
|
||||||
|
|
||||||
|
def write_uncommented(target, f):
|
||||||
|
block = []
|
||||||
|
is_comment = True
|
||||||
|
|
||||||
|
for line in target:
|
||||||
|
block.append(line)
|
||||||
|
if len(line) == 0:
|
||||||
|
if not is_comment:
|
||||||
|
for l in block:
|
||||||
|
f.write(l + "\n")
|
||||||
|
block = []
|
||||||
|
is_comment = True
|
||||||
|
continue
|
||||||
|
is_comment = is_comment and line.startswith('#')
|
||||||
|
return f
|
||||||
|
|
||||||
# Now that we've built up our `config.toml`, write it all out in the same
|
# Now that we've built up our `config.toml`, write it all out in the same
|
||||||
# order that we read it in.
|
# order that we read it in.
|
||||||
p("")
|
p("")
|
||||||
|
@ -494,11 +510,9 @@ with bootstrap.output('config.toml') as f:
|
||||||
for section in section_order:
|
for section in section_order:
|
||||||
if section == 'target':
|
if section == 'target':
|
||||||
for target in targets:
|
for target in targets:
|
||||||
for line in targets[target]:
|
f = write_uncommented(targets[target], f)
|
||||||
f.write(line + "\n")
|
|
||||||
else:
|
else:
|
||||||
for line in sections[section]:
|
f = write_uncommented(sections[section], f)
|
||||||
f.write(line + "\n")
|
|
||||||
|
|
||||||
with bootstrap.output('Makefile') as f:
|
with bootstrap.output('Makefile') as f:
|
||||||
contents = os.path.join(rust_dir, 'src', 'bootstrap', 'mk', 'Makefile.in')
|
contents = os.path.join(rust_dir, 'src', 'bootstrap', 'mk', 'Makefile.in')
|
||||||
|
|
Loading…
Add table
Reference in a new issue