summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-08-17 11:32:55 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-08-17 11:32:55 +0200
commiteb5c5c33151affc5861d181578d08de847955c52 (patch)
tree7696d1d4d1ab9647b3fa872f401869f23ce2ae7f
parent21906d51ac0cb76e680f4731335452d6e06c540f (diff)
bin/pkg: Collect provide-related hooks and execute them after everything else
-rwxr-xr-xbin/pkg12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index 31fe509..b6a601d 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -1,6 +1,8 @@
#!/usr/bin/env zsh
# pkg - /home package manager and zsh playground
+typeset -a -U triggers
+
##
## Internal functions for displaying stuff
##
@@ -373,11 +375,17 @@ update_provides () {
for package in *; {
if [[ -d $PDIR/$package ]] {
[[ $2 = 'remove' ]] && rm -r $package
- exec_hook $package 'post-update'
+ triggers+=$package
}
}
}
+apply_triggers () {
+ for package in $triggers; {
+ exec_hook $package 'post-update'
+ }
+}
+
wrap () {
function=$1
arg=$2
@@ -622,3 +630,5 @@ case $1 in
upgrade) wrap pkg_upgrade "$2" "Looking for updates" ;;
*) die "wait, what?\n" ;;
esac
+
+apply_triggers