From bb07caecab71598b97c080e6fb58d4b001b7fb76 Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 9 May 2020 18:58:48 +0000 Subject: kiss: add a warn function FossilOrigin-Name: fca825e07806a5cb601d4553825de734e4002e158a2910de2fdd35027eda78e7 --- kiss | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kiss b/kiss index d0fac12..6b3ee01 100755 --- a/kiss +++ b/kiss @@ -33,6 +33,11 @@ die() { exit 1 } +warn() { + # Print a warning message + log "WARN" "$1" "${2:-!>}" +} + contains() { # Check if a "string list" contains a word. case " $1 " in *" $2 "*) return 0; esac; return 1 @@ -968,7 +973,7 @@ pkg_etc() { # All other cases. *) - log WARN "($pkg_name) saving /$file as /$file.new" + warn "($pkg_name) saving /$file as /$file.new" "->" new=.new ;; esac @@ -1565,7 +1570,7 @@ main() { # Make sure that the KISS_ROOT doesn't end with a '/'. This might # break some operations. [ -z "$KISS_ROOT" ] || [ "${KISS_ROOT##*/}" ] || { - log warning "Your KISS_ROOT variable shouldn't end with '/'" "!>" + warn "Your KISS_ROOT variable shouldn't end with '/'" KISS_ROOT=${KISS_ROOT%/} } -- cgit v1.2.3