summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-26 22:20:53 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-26 22:20:53 +0200
commit253056ba0551afb4c3d4a443b1a555a6c8296d87 (patch)
treeca69653b2a11c0474309cfe9f8e5996f61de24d9
parentec8935c194042e2136afb2e61d11aeefda105ad4 (diff)
bin/pkg: Only update if new version is available
-rwxr-xr-xbin/pkg17
1 files changed, 11 insertions, 6 deletions
diff --git a/bin/pkg b/bin/pkg
index b9f05d1..57ff79e 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -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
}