diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-17 11:32:55 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-17 11:32:55 +0200 |
commit | eb5c5c33151affc5861d181578d08de847955c52 (patch) | |
tree | 7696d1d4d1ab9647b3fa872f401869f23ce2ae7f /bin | |
parent | 21906d51ac0cb76e680f4731335452d6e06c540f (diff) |
bin/pkg: Collect provide-related hooks and execute them after everything else
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 |