diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/devtool/__init__.py | 7 | ||||
-rw-r--r-- | scripts/lib/devtool/standard.py | 19 | ||||
-rw-r--r-- | scripts/lib/devtool/upgrade.py | 4 |
3 files changed, 19 insertions, 11 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 216b7c345ab..b432e3d44ec 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') diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 68742244171..0d5a42197b7 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -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() diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index fc2f919383d..a5063f57a98 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -227,7 +227,9 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin for f in stdout.splitlines(): __run('git add "%s"' % f) - __run('git commit -q -m "Commit of upstream changes at version %s" --allow-empty' % newpv) + useroptions = [] + oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd) + __run('git %s commit -q -m "Commit of upstream changes at version %s" --allow-empty' % (' '.join(useroptions), newpv)) __run('git tag -f devtool-base-%s' % newpv) (stdout, _) = __run('git rev-parse HEAD') |