diff --git a/config/projpaths.py b/config/projpaths.py index 7320416..60cdd49 100644 --- a/config/projpaths.py +++ b/config/projpaths.py @@ -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") diff --git a/configure.py b/configure.py index 537fbdc..8e45eff 100755 --- a/configure.py +++ b/configure.py @@ -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 + \