]> git.e2factory.org Git - e2factory.git/commitdiff
Expand and remove generic_source_check()
authorTobias Ulmer <tu@emlix.com>
Tue, 24 Jan 2017 16:48:03 +0000 (17:48 +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 8a7b06b4277180849a402252481da6ff582b8126..ae87c9d388b4fb5ff4f459fe87c01938f3cdcf84 100644 (file)
@@ -444,11 +444,18 @@ function cvs.toresult(info, sourcename, sourceset, directory)
     -- <directory>/licences
     local rc, re, out
     local e = err.new("converting result")
-    rc, re = scm.generic_source_check(info, sourcename, true)
+    local src = source.sources[sourcename]
+
+    rc, re = src:working_copy_available()
     if not rc then
         return false, e:cat(re)
     end
-    local src = source.sources[sourcename]
+
+    rc, re = src:check_workingcopy()
+    if not rc then
+        return false, e:cat(re)
+    end
+
     -- write makefile
     local makefile = "Makefile"
     local source = "source"
index aa860ffd12bd21e8472454a2a31a42aa3022fe6f..e6755083df4c126dfcb92ead9b65969ffceff25c 100644 (file)
@@ -493,8 +493,12 @@ function git.git_source:prepare_source(sourceset, buildpath)
 
     e = err.new("preparing git source %s failed", self._name)
 
-    info = e2tool.info()
-    rc, re = scm.generic_source_check(info, self._name, true)
+    rc, re = self:working_copy_available()
+    if not rc then
+        return false, e:cat(re)
+    end
+
+    rc, re = self:check_workingcopy()
     if not rc then
         return false, e:cat(re)
     end
@@ -544,6 +548,7 @@ function git.git_source:prepare_source(sourceset, buildpath)
 
     gitdir = e2lib.join(srcdir, ".git")
 
+    info = e2tool.info()
     rc, re = git.git_commit_id(info, self._name, sourceset)
     if not rc then
         return false, e:cat(re)
@@ -711,11 +716,18 @@ end
 function git.toresult(info, sourcename, sourceset, directory)
     local rc, re, argv
     local e = err.new("converting result")
-    rc, re = scm.generic_source_check(info, sourcename, true)
+    local src = source.sources[sourcename]
+
+    rc, re = src:working_copy_available()
     if not rc then
         return false, e:cat(re)
     end
-    local src = source.sources[sourcename]
+
+    rc, re = src:check_workingcopy()
+    if not rc then
+        return false, e:cat(re)
+    end
+
     local makefile = "Makefile"
     local source = "source"
     local sourcedir = e2lib.join(directory, source)
index 18b5db00261798c283e144f6670f91a8b0b079bd..a4e49763611f6a922f77006872c5132455808ef2 100644 (file)
@@ -175,7 +175,12 @@ function gitrepo_source:sourceid(sourceset)
         hash.hash_append(hc, lid)
     end
 
-    rc, re = scm.generic_source_check(e2tool.info(), self._name, true)
+    rc, re = self:working_copy_available()
+    if not rc then
+        return false, e:cat(re)
+    end
+
+    rc, re = self:check_workingcopy()
     if not rc then
         return false, e:cat(re)
     end
@@ -371,7 +376,12 @@ function gitrepo_source:update_source()
 
     e = err.new("updating source '%s' failed", self._name)
 
-    rc, re = scm.generic_source_check(e2tool.info(), self._name, true)
+    rc, re = self:working_copy_available()
+    if not rc then
+        return false, e:cat(re)
+    end
+
+    rc, re = self:check_workingcopy()
     if not rc then
         return false, e:cat(re)
     end
@@ -449,7 +459,12 @@ function gitrepo_source:prepare_source(sourceset, buildpath)
 
     e = err.new("preparing source failed: %s", self._name)
 
-    rc, re = scm.generic_source_check(e2tool.info(), self._name, true)
+    rc, re = self:working_copy_available()
+    if not rc then
+        return false, e:cat(re)
+    end
+
+    rc, re = self:check_workingcopy()
     if not rc then
         return false, e:cat(re)
     end
@@ -522,13 +537,18 @@ function gitrepo.toresult(info, sourcename, sourceset, directory)
     local argv
 
     e = err.new("converting source %q failed", sourcename)
+    src = source.sources[sourcename]
 
-    rc, re = scm.generic_source_check(info, sourcename, true)
+    rc, re = src:working_copy_available()
+    if not rc then
+        return false, e:cat(re)
+    end
+
+    rc, re = src:check_workingcopy()
     if not rc then
         return false, e:cat(re)
     end
 
-    src = source.sources[sourcename]
     srcdir = "source"
     sourcedir = e2lib.join(directory, srcdir)
     archive = string.format("%s.tar.gz", sourcename)
index 2bd753b9c6acce2b296ee21c1c93c7981c963b8f..d86f6c6fd2c21e5290f1a85061aaac92a03a998c 100644 (file)
@@ -479,11 +479,18 @@ function svn.toresult(info, sourcename, sourceset, directory)
     -- <directory>/licences
     local rc, re
     local e = err.new("converting result")
-    rc, re = scm.generic_source_check(info, sourcename, true)
+    local src = source.sources[sourcename]
+
+    rc, re = src:working_copy_available()
     if not rc then
         return false, e:cat(re)
     end
-    local src = source.sources[sourcename]
+
+    rc, re = src:check_workingcopy()
+    if not rc then
+        return false, e:cat(re)
+    end
+
     -- write makefile
     local makefile = "Makefile"
     local source = "source"