summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/pkg10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/pkg b/bin/pkg
index 035cfab..6c1445d 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -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 {