From: Tobias Ulmer Date: Fri, 3 May 2019 17:38:08 +0000 (+0200) Subject: git: tolerate improper configuration of source for development X-Git-Tag: e2factory-2.3.18rc1~2 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=139d2a5dc991c8c3754b73414d38b45a7d0b2214;p=e2factory.git git: tolerate improper configuration of source for development Often one wants to create a git repo and start doing some explorative work without setting up the repository on the server. Allow this by downgrading the error messages to very loud warnings. Will still fail to build in release mode. Due to design limitations, multiple warnings may appear, but this might be considered a good thing by some. Signed-off-by: Tobias Ulmer --- diff --git a/plugins/git.lua b/plugins/git.lua index 17389c4..fa93f0e 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -242,7 +242,14 @@ function git.git_source:git_commit_id(sourceset, check_remote) rc, re = self:check_workingcopy() if not rc then - return false, e:cat(re) + if check_remote or policy.opts.check() or policy.opts.check_remote() then + return false, e:cat(re) + else + -- allow building with an improper git workingcopy setup to ease + -- development, but complain about it loudly. + e2lib.warnf("WOTHER", "please fix: %s", + e:cat(re):tostring():gsub('\n', '')) + end end gitdir = e2lib.join(e2tool.root(), self:get_working(), ".git") @@ -623,7 +630,13 @@ function git.git_source:prepare_source(sourceset, buildpath) rc, re = self:check_workingcopy() if not rc then - return false, e:cat(re) + if policy.opts.check() or policy.opts.check_remote() then + return false, e:cat(re) + else + -- see git.git_source:git_commit_id() + e2lib.warnf("WOTHER", "please fix: %s", + e:cat(re):tostring():gsub('\n', '')) + end end srcdir = e2lib.join(e2tool.root(), self:get_working())