summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-24 19:53:59 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-24 19:53:59 +0200
commit193536b77797c5d2884e781adb93c92d8af5a39c (patch)
tree0b8749015bf16fc856db29ec6142f67ca8de6a86 /bin
parent46e6cfeda1cef8594815a4b2dbe23c7eb3ebdd84 (diff)
bin/pkg: split error into warn() and die()
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg11
1 files changed, 8 insertions, 3 deletions
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] "