From: Tobias Ulmer Date: Tue, 24 Jan 2017 16:48:03 +0000 (+0100) Subject: Expand and remove generic_source_check() X-Git-Tag: e2factory-2.3.17~40 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=f9db4384fb2ef3db18e11f5512ceee5f94e442e0;p=e2factory.git Expand and remove generic_source_check() Signed-off-by: Tobias Ulmer --- diff --git a/plugins/cvs.lua b/plugins/cvs.lua index 8a7b06b..ae87c9d 100644 --- a/plugins/cvs.lua +++ b/plugins/cvs.lua @@ -444,11 +444,18 @@ function cvs.toresult(info, sourcename, sourceset, 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" diff --git a/plugins/git.lua b/plugins/git.lua index aa860ff..e675508 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -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) diff --git a/plugins/gitrepo.lua b/plugins/gitrepo.lua index 18b5db0..a4e4976 100644 --- a/plugins/gitrepo.lua +++ b/plugins/gitrepo.lua @@ -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) diff --git a/plugins/svn.lua b/plugins/svn.lua index 2bd753b..d86f6c6 100644 --- a/plugins/svn.lua +++ b/plugins/svn.lua @@ -479,11 +479,18 @@ function svn.toresult(info, sourcename, sourceset, 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"