]> git.e2factory.org Git - e2factory.git/commitdiff
Add workdir argument to svn_tool() and use it
authorTobias Ulmer <tu@emlix.com>
Fri, 6 Dec 2013 13:33:22 +0000 (14:33 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
plugins/svn.lua

index d5f686f67839758b6f10b7cc2566e057946368b4..d97124dad5742fedca8e9ec2a12fdaff169a1a30 100644 (file)
@@ -75,6 +75,7 @@ end
 
 --- Call the svn command.
 -- @param argv table: vector with arguments for svn
+-- @param workdir Directory where svn command starts executing (optional).
 -- @return True on success, false on error or when svn returned with exit
 --         status other than 0.
 -- @return Error object on failure.
@@ -427,12 +428,8 @@ function svn.update(info, sourcename)
     end
     local e = err.new("updating source '%s' failed", sourcename)
     local src = info.sources[ sourcename ]
-    local working = e2lib.join(info.root, src.working)
-    rc, re = e2lib.chdir(working)
-    if not rc then
-        return false, e:cat(re)
-    end
-    rc, re = svn_tool({ "update", })
+    local workdir = e2lib.join(info.root, src.working)
+    rc, re = svn_tool({ "update" }, workdir)
     if not rc then
         return false, e:cat(re)
     end