aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-05-09 18:58:48 +0000
committermerakor <cem@ckyln.com>2020-05-09 18:58:48 +0000
commitbb07caecab71598b97c080e6fb58d4b001b7fb76 (patch)
tree8195b03a342fdaf46960e2de911c21233ddafd1d
parent9827f91075bc85047713f0537d3b732a29491ed6 (diff)
downloadcpt-bb07caecab71598b97c080e6fb58d4b001b7fb76.tar.gz
kiss: add a warn function
FossilOrigin-Name: fca825e07806a5cb601d4553825de734e4002e158a2910de2fdd35027eda78e7
-rwxr-xr-xkiss9
1 files 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%/}
}