]> git.e2factory.org Git - e2factory.git/commitdiff
plugins: skip fetch_source if working copy exists
authorTobias Ulmer <tu@emlix.com>
Thu, 19 Jan 2017 20:17:32 +0000 (21:17 +0100)
committerTobias Ulmer <tu@emlix.com>
Mon, 30 Jan 2017 13:33:34 +0000 (14:33 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
plugins/cvs.lua
plugins/git.lua
plugins/gitrepo.lua
plugins/svn.lua

index 5d63561d57704c7edf2b05b4dd0e8df7af14ad8d..f04d9a55d05f88be25d9f0c2b49c8046eb894c29 100644 (file)
@@ -319,6 +319,10 @@ end
 function cvs.fetch_source(info, sourcename)
     local rc, re, e, src, cvsroot, workdir, argv
 
+    if scm.working_copy_available(info, sourcename) then
+        return true
+    end
+
     e = err.new("fetching source failed: %s", sourcename)
     src = source.sources[sourcename]
 
@@ -407,6 +411,11 @@ function cvs.update(info, sourcename)
     e = err.new("updating source '%s' failed", sourcename)
     src = source.sources[sourcename]
 
+    rc, re = scm.working_copy_available(info, sourcename)
+    if not rc then
+        return false, e:cat(re)
+    end
+
     workdir = e2lib.join(info.root, src:get_working())
 
     argv = { "update", "-R" }
index 545a15544faba76fb444e4e5e2b0bb1722810bf2..5d9f017e804dc8a659e206dad4feeefc6d056dbd 100644 (file)
@@ -415,6 +415,10 @@ end
 function git.fetch_source(info, sourcename)
     local e, rc, re, src, git_dir, work_tree, id
 
+    if scm.working_copy_available(info, sourcename) then
+        return true
+    end
+
     src = source.sources[sourcename]
     e = err.new("fetching source failed: %s", sourcename)
 
index f3b5042aca15ab1d54385c4890a14571f36d6f35..753db21674190e3e9a189b61c404d84cf6d3e366 100644 (file)
@@ -250,6 +250,10 @@ function gitrepo.fetch_source(info, sourcename)
 
     local e, rc, re, src, git_dir, work_tree, id
 
+    if scm.working_copy_available(info, sourcename) then
+        return true
+    end
+
     src = source.sources[sourcename]
     e = err.new("fetching source failed: %s", sourcename)
 
index c5d357c0280d0d4a4d276b01f92604c52c526020..c64cf29d253b8a051e972ba27225d704f01209b8 100644 (file)
@@ -384,6 +384,10 @@ function svn.fetch_source(info, sourcename)
         return false, e:cat(re)
     end
 
+    if scm.working_copy_available(info, sourcename) then
+        return true
+    end
+
     local argv = { "checkout", svnurl, info.root .. "/" .. src:get_working() }
 
     rc, re = svn_tool(argv)