Without this "script" command, the "devtool build" provides a very
ambigous error: `/bin/sh: line 1: script: command not found`. With this
patch we provide a more detailed error.

On Fedora 43 the "script" command is not present by default, one needs
to install the "util-linux-script" package. On other systems it's in a
different package.

Signed-off-by: Walter Werner Schneider <[email protected]>
---
 scripts/lib/devtool/__init__.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index f47f57c465..58b02eb460 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -42,6 +42,9 @@ def exec_build_env_command(init_path, builddir, cmd, 
watch=False, **options):
         init_prefix = ''
     if watch:
         if sys.stdout.isatty():
+            import shutil
+            if not shutil.which('script'):
+                raise DevtoolError('The util-linux "script" command was not 
found')
             # Fool bitbake into thinking it's outputting to a terminal 
(because it is, indirectly)
             cmd = 'script -e -q -c "%s" /dev/null' % cmd
         return exec_watch('%s%s' % (init_prefix, cmd), **options)

---
base-commit: dcaea329458c741f47560d51732e3d9c88f3d5b4
change-id: 20260613-script-command-not-found-14e1a3be7410

Best regards,
-- 
Walter Werner Schneider <[email protected]>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#238678): 
https://lists.openembedded.org/g/openembedded-core/message/238678
Mute This Topic: https://lists.openembedded.org/mt/119786882/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to