summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.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/standard.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/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 6874224417..0d5a42197b 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -212,19 +212,19 @@ def add(args, config, basepath, workspace):
212 for fn in os.listdir(recipedir): 212 for fn in os.listdir(recipedir):
213 _add_md5(config, recipename, os.path.join(recipedir, fn)) 213 _add_md5(config, recipename, os.path.join(recipedir, fn))
214 214
215 tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
216 rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, None)
217 if not rd:
218 return 1
219
215 if args.fetchuri and not args.no_git: 220 if args.fetchuri and not args.no_git:
216 setup_git_repo(srctree, args.version, 'devtool') 221 setup_git_repo(srctree, args.version, 'devtool', d=tinfoil.config_data)
217 222
218 initial_rev = None 223 initial_rev = None
219 if os.path.exists(os.path.join(srctree, '.git')): 224 if os.path.exists(os.path.join(srctree, '.git')):
220 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) 225 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
221 initial_rev = stdout.rstrip() 226 initial_rev = stdout.rstrip()
222 227
223 tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
224 rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, None)
225 if not rd:
226 return 1
227
228 if args.src_subdir: 228 if args.src_subdir:
229 srctree = os.path.join(srctree, args.src_subdir) 229 srctree = os.path.join(srctree, args.src_subdir)
230 230
@@ -420,7 +420,10 @@ class BbTaskExecutor(object):
420 420
421class PatchTaskExecutor(BbTaskExecutor): 421class PatchTaskExecutor(BbTaskExecutor):
422 def __init__(self, rdata): 422 def __init__(self, rdata):
423 import oe.patch
423 self.check_git = False 424 self.check_git = False
425 self.useroptions = []
426 oe.patch.GitApplyTree.gitCommandUserOptions(self.useroptions, d=rdata)
424 super(PatchTaskExecutor, self).__init__(rdata) 427 super(PatchTaskExecutor, self).__init__(rdata)
425 428
426 def exec_func(self, func, report): 429 def exec_func(self, func, report):
@@ -447,7 +450,7 @@ class PatchTaskExecutor(BbTaskExecutor):
447 450
448 stdout, _ = bb.process.run('git status --porcelain', cwd=srcsubdir) 451 stdout, _ = bb.process.run('git status --porcelain', cwd=srcsubdir)
449 if stdout: 452 if stdout:
450 bb.process.run('git add .; git commit -a -m "Committing changes from %s\n\n%s"' % (func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir) 453 bb.process.run('git add .; git %s commit -a -m "Committing changes from %s\n\n%s"' % (' '.join(self.useroptions), func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir)
451 454
452 455
453def _prep_extract_operation(config, basepath, recipename, tinfoil=None): 456def _prep_extract_operation(config, basepath, recipename, tinfoil=None):
@@ -592,7 +595,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d):
592 "doesn't use any source or the correct source " 595 "doesn't use any source or the correct source "
593 "directory could not be determined" % pn) 596 "directory could not be determined" % pn)
594 597
595 setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch) 598 setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch, d=d)
596 599
597 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir) 600 (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
598 initial_rev = stdout.rstrip() 601 initial_rev = stdout.rstrip()