diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-02 10:49:22 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-02 10:49:22 +0200 |
commit | 1288cfab0988072a418873030663c8db9d5ee0f0 (patch) | |
tree | 3a003c54a4275cda8cfb45edf3a7b74392643132 /bin/pkg | |
parent | 79bed00fe8633faa9d913c4f607d16e027eb45be (diff) |
bin/pkg: Implemented provides (only with hooks, the rest is done by the package)
Diffstat (limited to 'bin/pkg')
-rwxr-xr-x | bin/pkg | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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 |