summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2020-06-02 23:50:24 +0200
committerAllan McRae <allan@archlinux.org>2020-06-11 02:54:54 +0200
commitbf458cced7c0845f7b6fabb887d3878ae4cd51b2 (patch)
tree974ba5f685f644d160e1535283565f523af3c40e /scripts/makepkg.sh.in
parent381e11375569fa7588b1297e0e744749bdafe8f5 (diff)
downloadpacman-bf458cced7c0845f7b6fabb887d3878ae4cd51b2.tar.gz
pacman-bf458cced7c0845f7b6fabb887d3878ae4cd51b2.tar.xz
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/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index f2859740..caf809f3 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -220,7 +220,7 @@ update_pkgver() {
# Print 'source not found' error message and exit makepkg
missing_source_file() {
error "$(gettext "Unable to find source file %s.")" "$(get_filename "$1")"
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit $E_MISSING_FILE
}
@@ -355,7 +355,7 @@ error_function() {
# first exit all subshells, then print the error
if (( ! BASH_SUBSHELL )); then
error "$(gettext "A failure occurred in %s().")" "$1"
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
fi
exit $E_USER_FUNCTION_FAILED
}
@@ -674,7 +674,7 @@ create_package() {
if [[ ! -d $pkgdir ]]; then
error "$(gettext "Missing %s directory.")" "\$pkgdir/"
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit $E_MISSING_PKGDIR
fi
@@ -1147,23 +1147,23 @@ lint_config || exit $E_CONFIG_ERROR
# check that all settings directories are user-writable
if ! ensure_writable_dir "BUILDDIR" "$BUILDDIR"; then
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit $E_FS_PERMISSIONS
fi
if (( ! (NOBUILD || GENINTEG) )) && ! ensure_writable_dir "PKGDEST" "$PKGDEST"; then
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit $E_FS_PERMISSIONS
fi
if ! ensure_writable_dir "SRCDEST" "$SRCDEST" ; then
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit $E_FS_PERMISSIONS
fi
if (( SOURCEONLY )); then
if ! ensure_writable_dir "SRCPKGDEST" "$SRCPKGDEST"; then
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit $E_FS_PERMISSIONS
fi
@@ -1173,7 +1173,7 @@ if (( SOURCEONLY )); then
fi
if (( LOGGING )) && ! ensure_writable_dir "LOGDEST" "$LOGDEST"; then
- plain "$(gettext "Aborting...")"
+ plainerr "$(gettext "Aborting...")"
exit $E_FS_PERMISSIONS
fi