From bf458cced7c0845f7b6fabb887d3878ae4cd51b2 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 2 Jun 2020 17:50:24 -0400 Subject: libmakepkg: fix regression in sending plain() output to stderr In commit 882e707e40bbade0111cf3bdedbdac4d4b70453b we changed message output to go to stdout by default, unless it was an error. The plain() function doesn't *look* like an error function, but in practice it was -- it's used to continue multiline messages, and all in-tree uses were for warning/error. This is a problem both because we're sending output to the wrong place, and because in some cases, we were performing error logging from a function which would otherwise return a value to be captured in a variable using command substution. Fix this and straighten out the API by providing two functions: one for continuing msg output, and one which wraps this by sending output to stderr, for continuing error output. Change all callers to use the second function. --- scripts/libmakepkg/source/bzr.sh.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/libmakepkg/source/bzr.sh.in') diff --git a/scripts/libmakepkg/source/bzr.sh.in b/scripts/libmakepkg/source/bzr.sh.in index 1227c739..d8e47185 100644 --- a/scripts/libmakepkg/source/bzr.sh.in +++ b/scripts/libmakepkg/source/bzr.sh.in @@ -52,7 +52,7 @@ download_bzr() { msg2 "$(gettext "Branching %s...")" "${displaylocation}" if ! bzr branch "$url" "$dir" --no-tree --use-existing-dir; then error "$(gettext "Failure while branching %s")" "${displaylocation}" - plain "$(gettext "Aborting...")" + plainerr "$(gettext "Aborting...")" exit 1 fi elif (( ! HOLDVER )); then @@ -83,7 +83,7 @@ extract_bzr() { ;; *) error "$(gettext "Unrecognized reference: %s")" "${fragment}" - plain "$(gettext "Aborting...")" + plainerr "$(gettext "Aborting...")" exit 1 esac fi @@ -98,12 +98,12 @@ extract_bzr() { cd_safe "${dir##*/}" if ! (bzr pull "$dir" -q --overwrite -r "$rev" && bzr clean-tree -q --detritus --force); then error "$(gettext "Failure while updating working copy of %s %s repo")" "${repo}" "bzr" - plain "$(gettext "Aborting...")" + plainerr "$(gettext "Aborting...")" exit 1 fi elif ! bzr checkout "$dir" -r "$rev"; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "bzr" - plain "$(gettext "Aborting...")" + plainerr "$(gettext "Aborting...")" exit 1 fi -- cgit v1.2.3-24-g4f1b