summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Kriek <vincent@coelebs.dev>2024-04-14 20:32:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-22 22:05:57 +0100
commit292ad5fdd032653b35d3f89758b92aa48f9a6491 (patch)
tree6db5eaef945bc9dea1d8e72cdc97959207efe27f
parent1686d6c45f1510619f8a0ab1dda9977b9ac3525d (diff)
downloadpoky-292ad5fdd032653b35d3f89758b92aa48f9a6491.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: d68d6008b7327809a47cccf50cc1bb0edc324e49) Signed-off-by: Vincent Kriek <vincent@coelebs.dev> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/devtool/standard.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 6674e67267..d0d8cb85a2 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,