]> git.e2factory.org Git - e2factory.git/commitdiff
Simplify generic_source_default_working()
authorTobias Ulmer <tu@emlix.com>
Tue, 15 Apr 2014 16:02:00 +0000 (18:02 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/scm.lua

index 43b996803d066efe85b01892643b5ea09c50e037..cb38345d8a3a43325ee0386c1795c6c407626120 100644 (file)
@@ -239,24 +239,18 @@ end
 -- @return bool
 -- @return an error object on failure
 function scm.generic_source_default_working(info, sourcename)
-    local src = info.sources[ sourcename ]
-    if src.working_default_applied then
-        return true
-    end
-    src.working_default_applied = true
-    local src_working_default = string.format("in/%s", sourcename)
-    if src.working and src.working ~= src_working_default then
-        e2lib.warnf("WPOLICY", "in source %s:", src.name)
-        e2lib.warnf("WPOLICY", " configuring non standard working direcory")
-    elseif src.working then
-        e2lib.warnf("WHINT", "in source %s:", src.name)
-        e2lib.warnf("WHINT", " no need to configure working directory")
-    else
-        src.working = string.format("in/%s", sourcename)
-        e2lib.warnf("WDEFAULT", "in source %s:", src.name)
-        e2lib.warnf("WDEFAULT",
-        " `working' attribute missing. Defaulting to '%s'.", src.working)
+    local src
+
+    src = info.sources[sourcename]
+
+    if not src.working then
+        src.working = e2lib.join("in", sourcename)
+
+        e2lib.warnf("WDEFAULT", "in source %s:", sourcename)
+        e2lib.warnf("WDEFAULT", " `working' attribute defaults to '%s'.",
+            src.working)
     end
+
     return true
 end