summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-29 20:40:38 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-03 23:45:52 +0100
commit4b4387455c62cf19fa3d215a11b5d0b1211d4570 (patch)
tree8c42428ddfb65fbd8b9ba7a7ef0632fff0e7bcdf /scripts/lib/devtool/__init__.py
parente5f61f85c550646bc7e26a1fe6d9df080864ef48 (diff)
downloadpoky-4b4387455c62cf19fa3d215a11b5d0b1211d4570.tar.gz
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]. (From OE-Core rev: 765a9017eaf77ea3204fb10afb8181629680bd82) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
-rw-r--r--scripts/lib/devtool/__init__.py7
1 files changed, 5 insertions, 2 deletions
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):
196 b_is_s = False 196 b_is_s = False
197 return b_is_s 197 return b_is_s
198 198
199def setup_git_repo(repodir, version, devbranch, basetag='devtool-base'): 199def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
200 """ 200 """
201 Set up the git repository for the source tree 201 Set up the git repository for the source tree
202 """ 202 """
203 import bb.process 203 import bb.process
204 import oe.patch
204 if not os.path.exists(os.path.join(repodir, '.git')): 205 if not os.path.exists(os.path.join(repodir, '.git')):
205 bb.process.run('git init', cwd=repodir) 206 bb.process.run('git init', cwd=repodir)
206 bb.process.run('git add .', cwd=repodir) 207 bb.process.run('git add .', cwd=repodir)
207 commit_cmd = ['git', 'commit', '-q'] 208 commit_cmd = ['git']
209 oe.patch.GitApplyTree.gitCommandUserOptions(commit_cmd, d=d)
210 commit_cmd += ['commit', '-q']
208 stdout, _ = bb.process.run('git status --porcelain', cwd=repodir) 211 stdout, _ = bb.process.run('git status --porcelain', cwd=repodir)
209 if not stdout: 212 if not stdout:
210 commit_cmd.append('--allow-empty') 213 commit_cmd.append('--allow-empty')