From afe0521495aeed0a22a3656e7bad193fba39805e Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Tue, 16 Apr 2024 16:50:33 -0400 Subject: meson.eclass: preserve exit status in phase funcs When the functions are called with nonfatal, we need to ensure 'popd' does not clobber the exit status of the called command. Update meson_src_configure as well just for consistency. Closes: https://bugs.gentoo.org/930119 Signed-off-by: Mike Gilbert --- eclass/meson.eclass | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'eclass') diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 9d7f830e58b0..a22a85887584 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -425,7 +425,10 @@ meson_src_configure() { export -n {C,CPP,CXX,F,OBJC,OBJCXX,LD}FLAGS PKG_CONFIG_{LIBDIR,PATH} echo meson setup "${MESONARGS[@]}" >&2 meson setup "${MESONARGS[@]}" - ) || die -n + ) + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "configure failed" + return ${rv} } # @FUNCTION: meson_src_compile @@ -451,9 +454,12 @@ meson_src_compile() { set -- meson compile "${mesoncompileargs[@]}" echo "$@" >&2 - "$@" || die -n "compile failed" + "$@" + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "compile failed" popd > /dev/null || die + return ${rv} } # @FUNCTION: meson_src_test @@ -473,9 +479,12 @@ meson_src_test() { set -- meson test "${mesontestargs[@]}" echo "$@" >&2 - "$@" || die -n "tests failed" + "$@" + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "tests failed" popd > /dev/null || die + return ${rv} } # @FUNCTION: meson_install @@ -495,9 +504,12 @@ meson_install() { set -- meson install "${mesoninstallargs[@]}" echo "$@" >&2 - "$@" || die -n "install failed" + "$@" + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "install failed" popd > /dev/null || die + return ${rv} } # @FUNCTION: meson_src_install -- cgit v1.2.3-65-gdbad