summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-04-10 09:06:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-12 17:27:53 +0100
commit834e91ce53511b564b8752fe8f4b9fa1ab22ec72 (patch)
tree0816e86966186a37742b84b172566fc8d9f7d2cb
parent55a03fca7f717ae5d2195f26195ea477db3e50c0 (diff)
downloadpoky-834e91ce53511b564b8752fe8f4b9fa1ab22ec72.tar.gz
devtool: standard: throws appropriate error if source is in detached HEAD
If source is in detached HEAD, we get the following error when using detvool finish command: [...] File "<...>/poky/scripts/lib/devtool/standard.py", line 1938, in _update_recipe bb.process.run('git checkout %s' % startbranch, cwd=srctree) File "<...>/poky/bitbake/lib/bb/process.py", line 189, in run raise ExecutionError(cmd, pipe.returncode, stdout, stderr) bb.process.ExecutionError: Execution of 'git checkout (HEAD detached at 9bbf87e)' failed with exit code 2: /bin/sh: -c: line 1: syntax error near unexpected token `(' /bin/sh: -c: line 1: `git checkout (HEAD detached at 9bbf87e)' Check this and throws an appropriate error in this case (From OE-Core rev: d9c686b5ff9f591ec6b928ed539084c02df4c8a5) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/devtool/standard.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 7972b4f822..6674e67267 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1885,6 +1885,8 @@ def _update_recipe(recipename, workspace, rd, mode, appendlayerdir, wildcard_ver
1885 for line in stdout.splitlines(): 1885 for line in stdout.splitlines():
1886 branchname = line[2:] 1886 branchname = line[2:]
1887 if line.startswith('* '): 1887 if line.startswith('* '):
1888 if 'HEAD' in line:
1889 raise DevtoolError('Detached HEAD - please check out a branch, e.g., "devtool"')
1888 startbranch = branchname 1890 startbranch = branchname
1889 if branchname.startswith(override_branch_prefix): 1891 if branchname.startswith(override_branch_prefix):
1890 override_branches.append(branchname) 1892 override_branches.append(branchname)