cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 4dbc128dfc48846ea4e92c2b1dadfeff61efd9d2
parent 8da844be30ad5883cad63864c433fbb130d7260d
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat,  9 May 2020 21:58:48 +0300

kiss: add a warn function

Diffstat:
Mkiss | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 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%/} }