Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/libmakepkg/util/source.sh.in
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2020-06-02 17:50:24 -0400
committerAllan McRae <allan@archlinux.org>2020-06-11 10:54:54 +1000
commitbf458cced7c0845f7b6fabb887d3878ae4cd51b2 (patch)
tree974ba5f685f644d160e1535283565f523af3c40e /scripts/libmakepkg/util/source.sh.in
parent381e11375569fa7588b1297e0e744749bdafe8f5 (diff)
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.
Diffstat (limited to 'scripts/libmakepkg/util/source.sh.in')
-rw-r--r--scripts/libmakepkg/util/source.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/libmakepkg/util/source.sh.in b/scripts/libmakepkg/util/source.sh.in
index e0490661..be7c15c2 100644
--- a/scripts/libmakepkg/util/source.sh.in
+++ b/scripts/libmakepkg/util/source.sh.in
@@ -156,7 +156,7 @@ get_downloadclient() {
# if we didn't find an agent, return an error
if [[ -z $agent ]]; then
error "$(gettext "Unknown download protocol: %s")" "$proto"
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit 1 # $E_CONFIG_ERROR
fi
@@ -165,7 +165,7 @@ get_downloadclient() {
if [[ ! -x $program ]]; then
local baseprog="${program##*/}"
error "$(gettext "The download program %s is not installed.")" "$baseprog"
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit 1 # $E_MISSING_PROGRAM
fi