diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-05-21 17:22:29 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-05-21 17:22:29 +0200 |
commit | 14d0790f67213085a9231a5fb8ac267d84dd6c6a (patch) | |
tree | c0b3230c490c8aa7abb05735ba07edab6388eccf | |
parent | 1157832dffda67049384f2fc57c6312e3e6834d2 (diff) |
bin/pkg: enable support of updating a single package
-rwxr-xr-x | bin/pkg | 36 |
1 files changed, 22 insertions, 14 deletions
@@ -66,19 +66,27 @@ pkg_remove () { } pkg_update () { - cd $PDIR - for i in *(/); { - echo_status "Updating package $i..." - check_deps "$i" - cd $i - $VCS_CMD $VCS_OPTIONS $VCS_UPDATE $VCS_UPDATE_OPTIONS - checklinks $CL_OPTIONS - if [ -f hooks/post-update ]; then - echo_status 'Executing post-update hook' - . hooks/post-update - fi - cd .. - } + cd $PDIR/$1 + echo_status "Updating package $1" + check_deps $1 + $VCS_CMD $VCS_OPTIONS $VCS_UPDATE $VCS_UPDATE_OPTIONS + checklinks $CL_OPTIONS + if [ -f hooks/post-update ]; then + echo_status 'Executing post-update hook' + . hooks/post-update + fi + cd .. +} + +pkg_update_wrapper () { + if [ -n "$1" ]; then + pkg_update "$1" + else + cd $PDIR + for i in *(/); { + pkg_update "$i" + } + fi } pkg_changesrc () { @@ -94,5 +102,5 @@ case "$1" in add) pkg_add "$2" ;; changeroot) pkg_changesrc "$2" ;; remove) pkg_remove "$2" ;; - update) pkg_update ;; + update) pkg_update_wrapper "$2" ;; esac |