From 200f57cf059a25fe011045ae4b64295639625354 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 31 May 2008 14:40:48 +0200 Subject: check priority before removing --- bin/pkg | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index 133d055..e16aa8b 100755 --- a/bin/pkg +++ b/bin/pkg @@ -90,6 +90,14 @@ pkg_remove () { info "Package '$1' is not installed!\n" return 100 } + cd $PDIR/$1 + if ([ -r priority ]) { + if ([ $(cat priority) -gt 3 ]) { + warn "Package '$1' is $(real_priority $(cat priority)). Really remove? [y/N] " + read + [ "$REPLY" = 'y' ] || return + } + } if ([ -f $PDIR/$1/hooks/pre-remove ]) { info 'Executing pre-remove hook\n' . $PDIR/$1/hooks/pre-remove -- cgit v1.2.3