From 3f8f69708248017f49a304ab8d1f57f26a4ccf7e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 11 Oct 2008 11:41:51 +0200 Subject: Automatically update on upgrade/push --- bin/pkg | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/pkg b/bin/pkg index f8178b4..01e6d6a 100755 --- a/bin/pkg +++ b/bin/pkg @@ -55,6 +55,7 @@ if [[ -f $HOME/.pkg.conf ]] { [[ -n $PKG_ROOT ]] || PKG_ROOT="ssh://derf.homelinux.org/home/derf/var/packages_root" [[ -n $CL_OPTIONS ]] || CL_OPTIONS=(-q) [[ -n $SILENT ]] || SILENT=0 +[[ -n $AUTOUPDATE ]] || AUTOUPDATE=1 info=$'\e[0;36m' error=$'\e[0;31m' reset=$'\e[0m' @@ -624,13 +625,19 @@ case $1 in list-all) pkg_list_available ;; local-update) pkg_update_local ;; log) pkg_log $2 ;; - push) wrap pkg_push "$2" "Pushing" ;; + push) + (( AUTOUPDATE )) && pkg_update + wrap pkg_push "$2" "Pushing" + ;; refresh) wrap pkg_refresh "$2" "Refreshing" ;; remote-update) pkg_update_remote ;; remove) pkg_remove $2 ;; status) wrap pkg_status "$2" "Checking package status" ;; update) pkg_update ;; - upgrade) wrap pkg_upgrade "$2" "Looking for updates" ;; + upgrade) + (( AUTOUPDATE )) && pkg_update_remote + wrap pkg_upgrade "$2" "Looking for updates" + ;; eval) shift; eval $* ;; *) die "wait, what?\npkg: unknown action: '$1'\n" ;; esac -- cgit v1.2.3