From d3696d878f9ed6eed46723550dff8c1b914b62da Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 29 Apr 2024 14:33:25 +0000 Subject: build: T3664: fail the build on external command errors (cherry picked from commit 7dfd9232da787a7befbc4338d4eb21fee4325174) --- scripts/image-build/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/image-build/utils.py') diff --git a/scripts/image-build/utils.py b/scripts/image-build/utils.py index 6906c52d..8c3ccbab 100644 --- a/scripts/image-build/utils.py +++ b/scripts/image-build/utils.py @@ -23,6 +23,7 @@ from distutils.spawn import find_executable # Local modules import defaults +import vyos def check_build_config(): if not os.path.exists(defaults.BUILD_CONFIG): @@ -76,3 +77,8 @@ def check_system_dependencies(deps): raise OSError(checker.format_missing_dependencies()) else: pass + +def cmd(command): + res = vyos.utils.process.call(command, shell=True) + if res > 0: + raise OSError(f"Command '{command}' failed") -- cgit v1.2.3