From: Markus Lehtonen Date: Fri, 13 May 2016 13:34:04 +0000 (+0300) Subject: oeqa.utils.git: support git commands with updated env X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~24529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b3c7c47f5d0fa473fe1db81b59b26531414781c;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa.utils.git: support git commands with updated env Extend GitRepo.run_cmd so that the caller may redefine and/or define additional environment variables that will be used when the git command is run. Signed-off-by: Markus Lehtonen Signed-off-by: Ross Burton --- diff --git a/meta/lib/oeqa/utils/git.py b/meta/lib/oeqa/utils/git.py index a4c6741f4e5..6a2987fbe80 100644 --- a/meta/lib/oeqa/utils/git.py +++ b/meta/lib/oeqa/utils/git.py @@ -30,9 +30,13 @@ class GitRepo(object): cmd_str, ret.status, ret.output)) return ret.output.strip() - def run_cmd(self, git_args): + def run_cmd(self, git_args, env_update=None): """Run Git command""" - return self._run_git_cmd_at(git_args, self.top_dir) + env = None + if env_update: + env = os.environ.copy() + env.update(env_update) + return self._run_git_cmd_at(git_args, self.top_dir, env=env)