]> git.e2factory.org Git - e2factory.git/commitdiff
create-project: if required, enable writeback and warn about it
authorTobias Ulmer <tu@emlix.com>
Thu, 3 Nov 2016 17:11:22 +0000 (18:11 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
It should deny working at all, but for now just have a warning.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
global/e2-create-project.lua

index b93ff67a43d992f1034225d20709817c9e058d5c..733f52dbf5d2ef38365e90d14ca566d7ed5a5db8 100644 (file)
@@ -136,6 +136,15 @@ local function e2_create_project(arg)
         error(e:cat(re))
     end
 
+    if not cache.writeback_enabled(scache, sl.server) then
+        e2lib.warnf("WOTHER", "enabling writeback for server: %s",
+            sl.server)
+        rc, re = cache.set_writeback(scache, sl.server, true)
+        if not rc then
+            error(e:cat(re))
+        end
+    end
+
     local p = {}
     p.version = buildconfig.GLOBAL_INTERFACE_VERSION[1] -- the project version
     p.e2version = string.format("%s %s",
@@ -176,7 +185,7 @@ local function e2_create_project(arg)
         end
 
         flocation = e2lib.join(p.location, f.filename)
-        rc, re = cache.push_file(scache, sourcefile, p.server, flocation, {})
+        rc, re = cache.push_file(scache, sourcefile, p.server, flocation)
         if not rc then
             error(e:cat(re))
         end