summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-08-02 10:49:22 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-08-02 10:49:22 +0200
commit1288cfab0988072a418873030663c8db9d5ee0f0 (patch)
tree3a003c54a4275cda8cfb45edf3a7b74392643132 /bin
parent79bed00fe8633faa9d913c4f607d16e027eb45be (diff)
bin/pkg: Implemented provides (only with hooks, the rest is done by the package)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg15
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index f6cebfb..051eb6e 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -228,7 +228,7 @@ exec_hook () {
package=$1
hook=$2
if [[ -r $PDIR/$package/hooks/$hook ]] {
- info "Executing $hook hook\n"
+ info "Executing $package $hook hook\n"
cd $PDIR/$package
. hooks/$hook
}
@@ -345,6 +345,16 @@ genocide_collected () {
}
}
+update_provides () {
+ [[ -d $PDIR/$1/provides ]] || return
+ cd $PDIR/$1/provides
+ for package in *; {
+ if [[ -d $PDIR/$package ]] {
+ [[ $2 = 'remove' ]] && rm -r $package
+ exec_hook $package 'post-update'
+ }
+ }
+}
##
## Finally - the functions actually doing something
@@ -368,6 +378,7 @@ pkg_add () {
check_conflicts $1
checklinks $CL_OPTIONS
populate_collected $1
+ update_provides $1
list_update_package $1
}
@@ -410,6 +421,7 @@ pkg_remove () {
genocide_collected $1
checklinks -r
list_remove_package $1
+ update_provides $1 'remove'
rm -rf $PDIR/$1
info "Package removed.\n"
}
@@ -432,6 +444,7 @@ pkg_upgrade () {
exec_hook $1 "post-update"
checklinks $CL_OPTIONS
populate_collected $1
+ update_provides $1
list_update_package $1
} else {
clear_line