From e66276b03b632895446c797004a4e794cc009e83 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 1 Jun 2008 23:58:47 +0200 Subject: bin/pkg: Don't remove non-packages --- bin/pkg | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/pkg b/bin/pkg index 43d245a..bbc31c2 100755 --- a/bin/pkg +++ b/bin/pkg @@ -109,10 +109,8 @@ pkg_add () { } pkg_remove () { - if ([ ! -d $PDIR/$1 ]) { - info "Package '$1' is not installed!\n" - return 100 - } + [ -d $PDIR/$1 ] || die "Package '$1' is not installed!\n" + [ -d $PDIR/$1/.hg ] || die "Not a valid package: '$1'\n" cd $PDIR/$1 if ([ -r priority ]) { if ([ $(cat priority) -gt 3 ]) { -- cgit v1.2.3