From 193536b77797c5d2884e781adb93c92d8af5a39c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 24 May 2008 19:53:59 +0200 Subject: bin/pkg: split error into warn() and die() --- bin/pkg | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/pkg b/bin/pkg index 5401492..5c59fa3 100755 --- a/bin/pkg +++ b/bin/pkg @@ -16,13 +16,17 @@ info () { echo "${info}$*${reset}" } -error () { +warn () { + echo "${error}$*${reset}" +} + +die () { echo "${error}$*${reset}" exit 100 } if [ ! -d $PDIR ]; then - error "$PDIR not found!!" + die "$PDIR not found!!" fi check_deps () { @@ -31,7 +35,8 @@ check_deps () { INSTALL=() for dep in $DEPS; { if [ "$dep" = "$1" ]; then - error "This package depends on itself. Therefore, I'm considering it borked. Not installing." + warn "This package depends on itself. Therefore, I'm considering it borked. Not installing." + return 100 fi if [ ! -d $PDIR/$dep ]; then echo -n "$1 depends on $dep. Install dependency? [Y/n] " -- cgit v1.2.3