summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-21 17:22:29 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-21 17:22:29 +0200
commit14d0790f67213085a9231a5fb8ac267d84dd6c6a (patch)
treec0b3230c490c8aa7abb05735ba07edab6388eccf
parent1157832dffda67049384f2fc57c6312e3e6834d2 (diff)
bin/pkg: enable support of updating a single package
-rwxr-xr-xbin/pkg36
1 files changed, 22 insertions, 14 deletions
diff --git a/bin/pkg b/bin/pkg
index ccdfa07..b813538 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -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