1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-26 07:07:08 +00:00

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>
This commit is contained in:
Paul Eggleton
2016-08-29 20:40:38 +12:00
committed by Richard Purdie
parent e5f61f85c5
commit 4b4387455c
5 changed files with 42 additions and 15 deletions
+11 -8
View File
@@ -212,19 +212,19 @@ def add(args, config, basepath, workspace):
for fn in os.listdir(recipedir):
_add_md5(config, recipename, os.path.join(recipedir, fn))
tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, None)
if not rd:
return 1
if args.fetchuri and not args.no_git:
setup_git_repo(srctree, args.version, 'devtool')
setup_git_repo(srctree, args.version, 'devtool', d=tinfoil.config_data)
initial_rev = None
if os.path.exists(os.path.join(srctree, '.git')):
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
initial_rev = stdout.rstrip()
tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
rd = oe.recipeutils.parse_recipe(tinfoil.cooker, recipefile, None)
if not rd:
return 1
if args.src_subdir:
srctree = os.path.join(srctree, args.src_subdir)
@@ -420,7 +420,10 @@ class BbTaskExecutor(object):
class PatchTaskExecutor(BbTaskExecutor):
def __init__(self, rdata):
import oe.patch
self.check_git = False
self.useroptions = []
oe.patch.GitApplyTree.gitCommandUserOptions(self.useroptions, d=rdata)
super(PatchTaskExecutor, self).__init__(rdata)
def exec_func(self, func, report):
@@ -447,7 +450,7 @@ class PatchTaskExecutor(BbTaskExecutor):
stdout, _ = bb.process.run('git status --porcelain', cwd=srcsubdir)
if stdout:
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)
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)
def _prep_extract_operation(config, basepath, recipename, tinfoil=None):
@@ -592,7 +595,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d):
"doesn't use any source or the correct source "
"directory could not be determined" % pn)
setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch)
setup_git_repo(srcsubdir, crd.getVar('PV', True), devbranch, d=d)
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
initial_rev = stdout.rstrip()