Restore configuration values with Configure.autoconfig='clobber' #1758

This commit is contained in:
Thomas Nagy 2016-06-18 01:06:23 +02:00
parent dcd01d6369
commit 8120504156
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
2 changed files with 8 additions and 4 deletions

View File

@ -169,6 +169,7 @@ class ConfigurationContext(Context.Context):
env = ConfigSet.ConfigSet()
env['argv'] = sys.argv
env['options'] = Options.options.__dict__
env['config_cmd'] = self.cmd
env.run_dir = Context.run_dir
env.top_dir = Context.top_dir

View File

@ -583,12 +583,15 @@ def autoconfigure(execute_method):
do_config = h != env.hash
if do_config:
Options.commands.insert(0, self.cmd)
Options.commands.insert(0, 'configure')
if Configure.autoconfig == 'clobber':
tmp = Options.options.__dict__
Options.options.__dict__ = env.options
return
try:
run_command(env['config_cmd'])
finally:
Options.options.__dict__ = tmp
else:
run_command(env['configure'])
return execute_method(self)
return execute
Build.BuildContext.execute = autoconfigure(Build.BuildContext.execute)