From 139d2a5dc991c8c3754b73414d38b45a7d0b2214 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 3 May 2019 19:38:08 +0200 Subject: [PATCH] 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 --- plugins/git.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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()) -- 2.39.5