summaryrefslogtreecommitdiff
path: root/bin/pkg
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-03 22:35:41 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-03 22:35:41 +0200
commit212359a78c786138c293cbc211b61be391b8107a (patch)
treee7978754053ecd25cc8749ba4aec9214424db9fc /bin/pkg
parentdac03563b33c1c3b39ea4820be150a468ba58238 (diff)
bin/pkg: Added genocide_collected for removing files from .collected
Diffstat (limited to 'bin/pkg')
-rwxr-xr-xbin/pkg27
1 files changed, 24 insertions, 3 deletions
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
}
}