diff options
author | Vincent Kriek <vincent@coelebs.dev> | 2024-04-14 20:32:47 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-06-19 08:34:58 -0700 |
commit | 99d16e4c35ba622707e1fddeda53a3a233c2b301 (patch) | |
tree | 260790976ff3081e1b4737ec158a7b56865871ac | |
parent | a39410ff489bb0da2a6bb4cdeff0eb2af843c46c (diff) | |
download | poky-99d16e4c35ba622707e1fddeda53a3a233c2b301.tar.gz |
devtool: sync: Fix Execution error
When executing devtool sync on a recipe that was extract with devtool
extract earlier the following error occured:
Traceback (most recent call last):
[...]
bb.process.ExecutionError: Execution of 'git fetch file:///home/vin/projects/poky/build/tmp/work/all-poky-linux/netbase/6.4/devtooltmp-figt1jmr/workdir/netbase devtool:devtool' failed with exit code 128:
fatal: refusing to fetch into branch 'refs/heads/devtool' checked out at '/home/vin/projects/poky/build/netbase-src'
Fix this by adding --update-head-ok and --force to git fetch so it will
override the current head even if it is checked out and has changes.
Possible existing changes in the devtool branch can be retrieved by
checking out the devtool.bak branch
(From OE-Core rev: ee712c8b3c32fedd6af0521d2e34ea655f8cd5ca)
Signed-off-by: Vincent Kriek <vincent@coelebs.dev>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 4c89b061003a0f4143c6d3838e39fc2643edc8d6)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | scripts/lib/devtool/standard.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 2beb058de8..05161942b7 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -661,7 +661,18 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works | |||
661 | srctree_localdir = os.path.join(srctree, 'oe-local-files') | 661 | srctree_localdir = os.path.join(srctree, 'oe-local-files') |
662 | 662 | ||
663 | if sync: | 663 | if sync: |
664 | bb.process.run('git fetch file://' + srcsubdir + ' ' + devbranch + ':' + devbranch, cwd=srctree) | 664 | try: |
665 | logger.info('Backing up current %s branch as branch: %s.bak' % (devbranch, devbranch)) | ||
666 | bb.process.run('git branch -f ' + devbranch + '.bak', cwd=srctree) | ||
667 | |||
668 | # Use git fetch to update the source with the current recipe | ||
669 | # To be able to update the currently checked out branch with | ||
670 | # possibly new history (no fast-forward) git needs to be told | ||
671 | # that's ok | ||
672 | logger.info('Syncing source files including patches to git branch: %s' % devbranch) | ||
673 | bb.process.run('git fetch --update-head-ok --force file://' + srcsubdir + ' ' + devbranch + ':' + devbranch, cwd=srctree) | ||
674 | except bb.process.ExecutionError as e: | ||
675 | raise DevtoolError("Error when syncing source files to local checkout: %s" % str(e)) | ||
665 | 676 | ||
666 | # Move the oe-local-files directory to srctree. | 677 | # Move the oe-local-files directory to srctree. |
667 | # As oe-local-files is not part of the constructed git tree, | 678 | # As oe-local-files is not part of the constructed git tree, |