mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Added quick saving of configuration with -s
This commit is contained in:
@@ -14,7 +14,7 @@ CML2_CONT_DEFFILE = join(PROJROOT, 'config/cml/container_ruleset.template')
|
||||
CML2TOOLSDIR = join(TOOLSDIR, "cml2-tools")
|
||||
CML2_COMPILED_RULES = join(BUILDDIR, "rules.compiled")
|
||||
CML2_CONFIG_FILE = join(BUILDDIR, "config.cml")
|
||||
CML2_OLDCONFIG_FILE = join(BUILDDIR, "oldconfig.cml.in")
|
||||
CML2_CONFIG_FILE_SAVED = join(BUILDDIR, "config.cml.saved")
|
||||
CML2_CONFIG_H = join(BUILDDIR, "config.h")
|
||||
CML2_AUTOGEN_RULES = join(BUILDDIR, 'config.rules')
|
||||
CONFIG_H = join("include/l4/config.h")
|
||||
|
||||
@@ -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