From: Gordon Hecker Date: Thu, 25 Feb 2010 16:52:01 +0000 (+0100) Subject: bugfix: the e2-cf tool refused to work in projects with a broken X-Git-Tag: e2factory-2.3.4pre2~5 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=a14f1045a5ec032cda8ce04e67a155578fd79037;p=e2factory.git bugfix: the e2-cf tool refused to work in projects with a broken configuration. That prevented the user from fixing a broken configuration using that tool, making the tool pretty much useless. Signed-off-by: Gordon Hecker --- diff --git a/local/cf.lua b/local/cf.lua index 66babe7..04bacfa 100755 --- a/local/cf.lua +++ b/local/cf.lua @@ -52,14 +52,12 @@ modify and create configuration files local opts = e2option.parse(arg) -local info, re = e2tool.collect_project_info() +-- initialize some basics in the info structure without actually loading +-- the project configuration. +local info, re = e2tool.collect_project_info(nil, true) if not info then e2lib.abort(re) end -local rc, re = e2tool.check_project_info(info) -if not rc then - e2lib.abort(re) -end rc, re = e2lib.chdir(info.root) if not rc then diff --git a/local/e2tool.lua b/local/e2tool.lua index 306cf29..d9772fe 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -378,7 +378,7 @@ function load_user_config2(info, path, types) return list, nil end -function collect_project_info(path) +function collect_project_info(path, skip_load_config) local rc, re local e = new_error("reading project configuration") @@ -454,6 +454,10 @@ The newest configuration syntax supported by the tools is %s. e2lib.init2() -- configuration must be available + if skip_load_config == true then + return info + end + local rc, re = opendebuglogfile(info) if not rc then return false, e:cat(re)