]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
toaster.bbclass: Support layers that are not Git repositories
authorPeter Kjellerstedt <pkj@axis.com>
Wed, 17 Jun 2026 09:40:37 +0000 (11:40 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 Jun 2026 10:22:51 +0000 (11:22 +0100)
Not all layers are Git repositories, e.g., the workspace layer created
by devtool.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes/toaster.bbclass

index 5878230062c557fb3ae4f7154570497013917701..f6a6f87de5e7c77cfb67578ba0e173c8d8ef3171 100644 (file)
@@ -32,12 +32,12 @@ python toaster_layerinfo_dumpdata() {
     import subprocess
 
     def _get_git_branch(layer_path):
-        branch = subprocess.check_output(['git', 'symbolic-ref', 'HEAD'], cwd=layer_path, text=True).strip()
+        branch = subprocess.run(['git', 'symbolic-ref', 'HEAD'], cwd=layer_path, text=True, stdout=subprocess.PIPE).stdout.strip()
         branch = branch.replace('refs/heads/', '').rstrip()
         return branch
 
     def _get_git_revision(layer_path):
-        revision = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=layer_path, text=True).strip()
+        revision = subprocess.run(['git', 'rev-parse', 'HEAD'], cwd=layer_path, text=True, stdout=subprocess.PIPE).stdout.strip()
         return revision
 
     def _get_url_map_name(layer_name):