index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2020-06-02 17:50:24 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2020-06-11 10:54:54 +1000 |
commit | bf458cced7c0845f7b6fabb887d3878ae4cd51b2 (patch) | |
tree | 974ba5f685f644d160e1535283565f523af3c40e /scripts/libmakepkg/util | |
parent | 381e11375569fa7588b1297e0e744749bdafe8f5 (diff) |
-rw-r--r-- | scripts/libmakepkg/util/config.sh.in | 2 | ||||
-rw-r--r-- | scripts/libmakepkg/util/message.sh.in | 8 | ||||
-rw-r--r-- | scripts/libmakepkg/util/source.sh.in | 4 | ||||
-rw-r--r-- | scripts/libmakepkg/util/util.sh.in | 2 |
diff --git a/scripts/libmakepkg/util/config.sh.in b/scripts/libmakepkg/util/config.sh.in index a8975d6d..ea909f84 100644 --- a/scripts/libmakepkg/util/config.sh.in +++ b/scripts/libmakepkg/util/config.sh.in @@ -39,7 +39,7 @@ source_makepkg_config() { source_safe "$MAKEPKG_CONF" else error "$(gettext "%s not found.")" "$MAKEPKG_CONF" - plain "$(gettext "Aborting...")" + plainerr "$(gettext "Aborting...")" exit $E_CONFIG_ERROR fi diff --git a/scripts/libmakepkg/util/message.sh.in b/scripts/libmakepkg/util/message.sh.in index 061bd858..625f11b1 100644 --- a/scripts/libmakepkg/util/message.sh.in +++ b/scripts/libmakepkg/util/message.sh.in @@ -43,12 +43,20 @@ colorize() { readonly ALL_OFF BOLD BLUE GREEN RED YELLOW } +# plainerr/plainerr are primarily used to continue a previous message on a new +# line, depending on whether the first line is a regular message or an error +# output + plain() { (( QUIET )) && return local mesg=$1; shift printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" } +plainerr() { + plain "$@" >&2 +} + msg() { (( QUIET )) && return local mesg=$1; shift 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 diff --git a/scripts/libmakepkg/util/util.sh.in b/scripts/libmakepkg/util/util.sh.in index 8f6d6d3a..d1d11eb3 100644 --- a/scripts/libmakepkg/util/util.sh.in +++ b/scripts/libmakepkg/util/util.sh.in @@ -78,7 +78,7 @@ dir_is_empty() { cd_safe() { if ! cd "$1"; then error "$(gettext "Failed to change to directory %s")" "$1" - plain "$(gettext "Aborting...")" + plainerr "$(gettext "Aborting...")" exit 1 fi } |