mirror of
https://github.com/drasko/codezero.git
synced 2026-01-20 14:53:16 +01:00
Added quick saving of configuration with -s
This commit is contained in:
@@ -98,7 +98,7 @@ def build_parse_options():
|
||||
|
||||
# -f or -r or -n or -a implies -c
|
||||
if options.cml_file or options.ncont or options.arch or options.reset_config \
|
||||
or not os.path.exists(BUILDDIR):
|
||||
or not os.path.exists(BUILDDIR) or not os.path.exists(CONFIG_SHELVE_DIR):
|
||||
options.config = 1
|
||||
|
||||
return options, args
|
||||
@@ -139,6 +139,13 @@ def configure_system(options, args):
|
||||
os.system(CML2TOOLSDIR + '/cmlcompile.py -o ' + \
|
||||
CML2_COMPILED_RULES + ' ' + rules_file)
|
||||
|
||||
#
|
||||
# If there was an existing config file in default cml path
|
||||
# and -s was supplied, save it.
|
||||
#
|
||||
if os.path.exists(CML2_CONFIG_FILE) and options.backup_config:
|
||||
shutil.copy(CML2_CONFIG_FILE, CML2_CONFIG_FILE_SAVED)
|
||||
|
||||
# Create configuration from existing file
|
||||
os.system(CML2TOOLSDIR + '/cmlconfigure.py -c -o ' + \
|
||||
CML2_CONFIG_FILE + ' -i ' + cml2_config_file + \
|
||||
|
||||
Reference in New Issue
Block a user