From 5b2ff51c399a906fd70df62ca179e2a696ea3860 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 29 Aug 2018 01:10:21 -0400 Subject: makepkg: don't print status for run_function when in a subshell It's most likely a case where output is being captured, so we shouldn't be interleaving status messages with function output regardless. Setting the pkgver() status message (the one time we use it in a subshell) separately also makes it safe to change whether message.sh functions write to stdout or stderr. Signed-off-by: Eli Schwartz Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 4e8f9dc3..89a31148 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -187,6 +187,7 @@ enter_fakeroot() { # Automatically update pkgver variable if a pkgver() function is provided # Re-sources the PKGBUILD afterwards to allow for other variables that use $pkgver update_pkgver() { + msg "$(gettext "Starting %s()...")" "pkgver" newpkgver=$(run_function_safe pkgver) if (( $? != 0 )); then error_function pkgver @@ -447,7 +448,9 @@ run_function() { fi local pkgfunc="$1" - msg "$(gettext "Starting %s()...")" "$pkgfunc" + if (( ! BASH_SUBSHELL )); then + msg "$(gettext "Starting %s()...")" "$pkgfunc" + fi cd_safe "$srcdir" local ret=0 -- cgit v1.2.3-70-g09d2