diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-05-26 22:20:53 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-05-26 22:20:53 +0200 |
commit | 253056ba0551afb4c3d4a443b1a555a6c8296d87 (patch) | |
tree | ca69653b2a11c0474309cfe9f8e5996f61de24d9 | |
parent | ec8935c194042e2136afb2e61d11aeefda105ad4 (diff) |
bin/pkg: Only update if new version is available
-rwxr-xr-x | bin/pkg | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -4,6 +4,7 @@ PKG_ROOT="ssh://derf.homelinux.org/var/packages_root" VCS_CMD="hg" VCS_OPTIONS="--quiet" VCS_ADD="clone" +VCS_INCOMING="incoming" VCS_STATUS="status" VCS_UPDATE="pull" VCS_UPDATE_OPTIONS="--update" @@ -91,12 +92,16 @@ pkg_remove () { pkg_update () { cd $PDIR/$1 - info "Updating package $1" - $VCS_CMD $VCS_OPTIONS $VCS_UPDATE $VCS_UPDATE_OPTIONS - checklinks $CL_OPTIONS - if [ -f hooks/post-update ]; then - info 'Executing post-update hook' - . hooks/post-update + if $VCS_CMS $VCS_OPTIONS $VCS_INCOMING; then + info "Updating package $1" + $VCS_CMD $VCS_OPTIONS $VCS_UPDATE $VCS_UPDATE_OPTIONS + checklinks $CL_OPTIONS + if [ -f hooks/post-update ]; then + info 'Executing post-update hook' + . hooks/post-update + fi + else + info "up-to-date: $1" fi cd $PDIR } |