]> git.e2factory.org Git - e2factory.git/commitdiff
bugfix: fix unintended recursion into non-directories searching for
authorGordon Hecker <gh@emlix.com>
Tue, 2 Mar 2010 17:00:07 +0000 (18:00 +0100)
committerGordon Hecker <gh@emlix.com>
Tue, 2 Mar 2010 17:02:26 +0000 (18:02 +0100)
source/result configuration

Signed-off-by: Gordon Hecker <gh@emlix.com>
local/e2tool.lua

index de79191f538bf0206660217e6c80a39b24ad4820..cfc3be160eb17c1e3f6cc8faf7f3af1b66cdd840 100644 (file)
@@ -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