From ef6a356ad9ab6d11e8b45055dea9bd30da2096af Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 23 Apr 2009 19:06:42 +0200 Subject: pkg: list_update_remote: Don't rely on ssh return status, !=0 does not always indicate failure --- bin/pkg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/pkg') diff --git a/bin/pkg b/bin/pkg index ec28da6..d76d9bb 100755 --- a/bin/pkg +++ b/bin/pkg @@ -338,11 +338,11 @@ function list_update_remote { typeset -i ret=0 export PDIR if [[ $PKG_PROTO == 'ssh' ]] { - ssh $PKG_USER@$PKG_HOST "PDIR='$PDIR' $PKGLIST_PATH $PKG_PATH" > $tmpfile || ret=$? + ssh $PKG_USER@$PKG_HOST "PDIR='$PDIR' $PKGLIST_PATH $PKG_PATH" > $tmpfile } elif [[ $PKG_PROTO == 'file' ]] { - $PKGLIST_PATH $PKG_PATH > $tmpfile || ret=$? + $PKGLIST_PATH $PKG_PATH > $tmpfile } - if (( ret == 0 )) { + if [[ -n $(cat $tmpfile) ]] { cp $tmpfile .list-remote } else { die "remote list update failed\n" \ -- cgit v1.2.3