diff options
-rwxr-xr-x | bin/pkg | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -296,12 +296,18 @@ function list_type_local { } function list_update_remote { + typeset tmpfile=$(mktemp pkglist.XXXXXX) + typeset -i ret=0 export PDIR if [[ $PKG_PROTO == 'ssh' ]] { - ssh $PKG_USER@$PKG_HOST "PDIR='$PDIR' $PKG_PATH/core/include/pkglist $PKG_PATH" > .list-remote + ssh $PKG_USER@$PKG_HOST "PDIR='$PDIR' $PKG_PATH/core/include/pkglist $PKG_PATH" > $tmpfile || ret=$? } elif [[ $PKG_PROTO == 'file' ]] { - $PKG_PATH/core/include/pkglist $PKG_PATH > .list-remote + $PKG_PATH/core/include/pkglist $PKG_PATH > $tmpfile || ret=$? } + if (( ret == 0 )) { + cp $tmpfile .list-remote + } + rm $tmpfile } function list_update_local { |