From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mail.openembedded.org (Postfix) with ESMTP id E7D546FF9F for ; Wed, 24 Aug 2016 07:13:24 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 24 Aug 2016 00:13:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,569,1464678000"; d="scan'208";a="1040620601" Received: from marquiz.fi.intel.com ([10.237.72.155]) by orsmga002.jf.intel.com with ESMTP; 24 Aug 2016 00:13:14 -0700 From: Markus Lehtonen To: openembedded-core@lists.openembedded.org Date: Wed, 24 Aug 2016 10:12:53 +0300 Message-Id: <1472022789-13028-4-git-send-email-markus.lehtonen@linux.intel.com> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1472022789-13028-1-git-send-email-markus.lehtonen@linux.intel.com> References: <1472022789-13028-1-git-send-email-markus.lehtonen@linux.intel.com> Subject: [PATCH 03/19] oeqa.utils.git: support git commands with updated env X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 07:13:25 -0000 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 --- meta/lib/oeqa/utils/git.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/utils/git.py b/meta/lib/oeqa/utils/git.py index a4c6741..6a2987f 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) -- 2.6.6