From: Gordon Hecker Date: Tue, 2 Mar 2010 17:00:07 +0000 (+0100) Subject: bugfix: fix unintended recursion into non-directories searching for X-Git-Tag: e2factory-2.3.4pre2~2 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=acd3f0c781ccf96b74043183fcb9713f4e0beea2;p=e2factory.git bugfix: fix unintended recursion into non-directories searching for source/result configuration Signed-off-by: Gordon Hecker --- diff --git a/local/e2tool.lua b/local/e2tool.lua index de79191..cfc3be1 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -2525,11 +2525,14 @@ local function gather_result_paths(info, basedir, results) else tmp = dir end - if e2util.exists(resultconfig(tmp)) then - table.insert(results, tmp) - else - --try subfolder - gather_result_paths(info,tmp, results) + local s = e2util.stat(info.root .. "/" .. resultdir(tmp), false) + if s.type == "directory" then + if e2util.exists(resultconfig(tmp)) then + table.insert(results, tmp) + else + --try subfolder + gather_result_paths(info,tmp, results) + end end end return results @@ -2545,11 +2548,14 @@ local function gather_source_paths(info, basedir, sources) else tmp = dir end - if e2util.exists(sourceconfig(tmp)) then - table.insert(sources, tmp) - else - --try subfolder - gather_source_paths(info,tmp, sources) + local s = e2util.stat(info.root .. "/" .. sourcedir(tmp), false) + if s.type == "directory" then + if e2util.exists(sourceconfig(tmp)) then + table.insert(sources, tmp) + else + --try subfolder + gather_source_paths(info,tmp, sources) + end end end return sources