From 212359a78c786138c293cbc211b61be391b8107a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 3 Jun 2008 22:35:41 +0200 Subject: bin/pkg: Added genocide_collected for removing files from .collected --- bin/pkg | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index c886d90..1800c13 100755 --- a/bin/pkg +++ b/bin/pkg @@ -27,6 +27,10 @@ die () { exit 100 } +clear_line () { + echo -ne "\r \r" +} + # Local configuration if ([ -f $HOME/.pkg.conf ]) { . $HOME/.pkg.conf @@ -122,7 +126,23 @@ populate_collected () { echo -n "." } } - info "\r \r" + clear_line +} + +genocide_collected () { + cd $PDIR/$1 || return + info "Removing documentation" + if ([ -d doc ]) { + for i in doc/*; { + rm $PDIR/.collected/$i + } + } + if ([ -d bin ]) { + for i in bin/*; { + rm -f $PDIR/.collected/man/man1/$(basename $i).1 + } + } + clear_line } pkg_add () { @@ -163,6 +183,7 @@ pkg_remove () { . $PDIR/$1/hooks/pre-remove } rm -r $PDIR/$1 + genocide_collected "$1" info "Package removed.\n" } @@ -185,7 +206,7 @@ pkg_update () { checklinks $CL_OPTIONS populate_collected "$1" } else { - info "\r \r" + clear_line } cd $PDIR } @@ -231,7 +252,7 @@ pkg_status () { info "\rLocally modified in $1:\n" echo "$STATUS" } else { - info "\r \r" + clear_line } } -- cgit v1.2.3