if os.path.exists(patchdir):
shutil.rmtree(patchdir)
if haspatches:
- stdout, _ = bb.process.run('git status --porcelain patches', cwd=srcsubdir)
+ stdout, _ = bb.process.run(['git', 'status', '--porcelain', 'patches'], cwd=srcsubdir)
if stdout:
- bb.process.run('git checkout patches', cwd=srcsubdir)
- stdout, _ = bb.process.run('git status --porcelain .', cwd=srcsubdir)
+ bb.process.run(['git', 'checkout', 'patches'], cwd=srcsubdir)
+ stdout, _ = bb.process.run(['git', 'status', '--porcelain', '.'], cwd=srcsubdir)
if stdout:
oe.patch.GitApplyTree.commitIgnored("Add changes from %s" % func, dir=srcsubdir, files=['.'], d=d)
}
devbranch = d.getVar('DEVTOOL_DEVBRANCH')
setup_git_repo(srcsubdir, d.getVar('PV'), devbranch, d=d)
- (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
+ (stdout, _) = bb.process.run(['git', 'rev-parse', 'HEAD'], cwd=srcsubdir)
initial_rev = stdout.rstrip()
with open(os.path.join(tempdir, 'initial_rev'), 'w') as f:
f.write(initial_rev)
shutil.rmtree(patches_dir)
# Restore any "patches" directory that was actually part of the source tree
try:
- bb.process.run('git checkout -- patches', cwd=srcsubdir)
+ bb.process.run(['git', 'checkout', '--', 'patches'], cwd=srcsubdir)
except bb.process.ExecutionError:
pass
if default_overrides != no_overrides:
# Some overrides are active in the current configuration, so
# we need to create a branch where none of the overrides are active
- bb.process.run('git checkout %s -b devtool-no-overrides' % initial_rev, cwd=srcsubdir)
+ bb.process.run(['git', 'checkout', initial_rev, '-b', 'devtool-no-overrides'], cwd=srcsubdir)
# Run do_patch function with the override applied
localdata = bb.data.createCopy(d)
localdata.setVar('OVERRIDES', ':'.join(no_overrides))
rm_patches()
# Now we need to reconcile the dev branch with the no-overrides one
# (otherwise we'd likely be left with identical commits that have different hashes)
- bb.process.run('git checkout %s' % devbranch, cwd=srcsubdir)
- bb.process.run('git rebase devtool-no-overrides', cwd=srcsubdir)
+ bb.process.run(['git', 'checkout', devbranch], cwd=srcsubdir)
+ bb.process.run(['git', 'rebase', 'devtool-no-overrides'], cwd=srcsubdir)
else:
- bb.process.run('git checkout %s -b devtool-no-overrides' % devbranch, cwd=srcsubdir)
+ bb.process.run(['git', 'checkout', devbranch, '-b', 'devtool-no-overrides'], cwd=srcsubdir)
for override in extra_overrides:
localdata = bb.data.createCopy(d)
if override in default_overrides:
- bb.process.run('git branch devtool-override-%s %s' % (override, devbranch), cwd=srcsubdir)
+ bb.process.run(['git', 'branch', 'devtool-override-' + override, devbranch], cwd=srcsubdir)
else:
# Reset back to the initial commit on a new branch
- bb.process.run('git checkout %s -b devtool-override-%s' % (initial_rev, override), cwd=srcsubdir)
+ bb.process.run(['git', 'checkout', initial_rev, '-b', 'devtool-override-' + override], cwd=srcsubdir)
# Run do_patch function with the override applied
localdata.setVar('OVERRIDES', ':'.join(no_overrides + [override]))
localdata.setVar('FILESOVERRIDES', ':'.join(no_overrides + [override]))
rm_patches()
# Now we need to reconcile the new branch with the no-overrides one
# (otherwise we'd likely be left with identical commits that have different hashes)
- bb.process.run('git rebase devtool-no-overrides', cwd=srcsubdir)
- bb.process.run('git checkout %s' % devbranch, cwd=srcsubdir)
- bb.process.run('git tag -f --no-sign devtool-patched', cwd=srcsubdir)
+ bb.process.run(['git', 'rebase', 'devtool-no-overrides'], cwd=srcsubdir)
+ bb.process.run(['git', 'checkout', devbranch], cwd=srcsubdir)
+ bb.process.run(['git', 'tag', '-f', '--no-sign', 'devtool-patched'], cwd=srcsubdir)
if os.path.exists(os.path.join(srcsubdir, '.gitmodules')):
- bb.process.run('git submodule foreach --recursive "git tag -f --no-sign devtool-patched"', cwd=srcsubdir)
+ bb.process.run(['git', 'submodule', 'foreach', '--recursive', 'git tag -f --no-sign devtool-patched'], cwd=srcsubdir)
}
def get_metadata_git_branch(path):
try:
- rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path)
+ rev, _ = bb.process.run(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=path)
except (bb.process.ExecutionError, bb.process.NotFoundError):
rev = '<unknown>'
return rev.strip()
def get_metadata_git_revision(path):
try:
- rev, _ = bb.process.run('git rev-parse HEAD', cwd=path)
+ rev, _ = bb.process.run(['git', 'rev-parse', 'HEAD'], cwd=path)
except (bb.process.ExecutionError, bb.process.NotFoundError):
rev = '<unknown>'
return rev.strip()
def get_metadata_git_toplevel(path):
try:
- toplevel, _ = bb.process.run('git rev-parse --show-toplevel', cwd=path)
+ toplevel, _ = bb.process.run(['git', 'rev-parse', '--show-toplevel'], cwd=path)
except (bb.process.ExecutionError, bb.process.NotFoundError):
return ""
return toplevel.strip()
def get_metadata_git_remotes(path):
try:
- remotes_list, _ = bb.process.run('git remote', cwd=path)
+ remotes_list, _ = bb.process.run(['git', 'remote'], cwd=path)
remotes = remotes_list.split()
except (bb.process.ExecutionError, bb.process.NotFoundError):
remotes = []
def get_metadata_git_remote_url(path, remote):
try:
- uri, _ = bb.process.run('git remote get-url {remote}'.format(remote=remote), cwd=path)
+ uri, _ = bb.process.run(['git', 'remote', 'get-url', remote], cwd=path)
except (bb.process.ExecutionError, bb.process.NotFoundError):
return ""
return uri.strip()
def get_metadata_git_describe(path):
try:
- describe, _ = bb.process.run('git describe --tags --dirty', cwd=path)
+ describe, _ = bb.process.run(['git', 'describe', '--tags', '--dirty'], cwd=path)
except (bb.process.ExecutionError, bb.process.NotFoundError):
return ""
return describe.strip()