From 765a9017eaf77ea3204fb10afb8181629680bd82 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 29 Aug 2016 20:40:38 +1200 Subject: lib/oe/patch: commit with a dummy user/email when PATCHTOOL=git When using PATCHTOOL = "git", the user of the system is not really the committer - it's the build system itself. Thus, specify "dummy" values for username and email instead of using the user's configured values. Various parts of the devtool code that need to make commits have also been updated to use the same logic. This allows PATCHTOOL = "git" and devtool to be used on systems where git user.name / user.email has not been set (on versions of git where it doesn't default a value under this circumstance). If you want to return to the old behaviour where the externally configured user name / email are used, set the following in your local.conf: PATCH_GIT_USER_NAME = "" PATCH_GIT_USER_EMAIL = "" Fixes [YOCTO #8703]. Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/lib/devtool/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/lib/devtool/__init__.py') diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 216b7c345a..b432e3d44e 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -196,15 +196,18 @@ def use_external_build(same_dir, no_same_dir, d): b_is_s = False return b_is_s -def setup_git_repo(repodir, version, devbranch, basetag='devtool-base'): +def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None): """ Set up the git repository for the source tree """ import bb.process + import oe.patch if not os.path.exists(os.path.join(repodir, '.git')): bb.process.run('git init', cwd=repodir) bb.process.run('git add .', cwd=repodir) - commit_cmd = ['git', 'commit', '-q'] + commit_cmd = ['git'] + oe.patch.GitApplyTree.gitCommandUserOptions(commit_cmd, d=d) + commit_cmd += ['commit', '-q'] stdout, _ = bb.process.run('git status --porcelain', cwd=repodir) if not stdout: commit_cmd.append('--allow-empty') -- cgit 1.2.3-korg