From 3f600d03fa7069933726ae577da3fcb47845b064 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Sat, 13 Feb 2016 15:22:34 +0000 Subject: [PATCH 1/3] qvm-move-to-vm: Remove duplicated code --- qubes-rpc/qvm-move-to-vm | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/qubes-rpc/qvm-move-to-vm b/qubes-rpc/qvm-move-to-vm index 80d456e..2212c38 100755 --- a/qubes-rpc/qvm-move-to-vm +++ b/qubes-rpc/qvm-move-to-vm @@ -20,25 +20,6 @@ # # -if [ $# -lt 2 ] ; then - echo usage: $0 '[--without-progress] dest_vmname file [file]+' - exit 1 -fi - -if [ x"$1" = "x--without-progress" ] ; then - export PROGRESS_TYPE=none - shift -else - export PROGRESS_TYPE=console -fi - - -VM="$1" -shift - -if [ $PROGRESS_TYPE = console ] ; then - export FILECOPY_TOTAL_SIZE=$(du --apparent-size -c -- "$@" 2> /dev/null | tail -1 | cut -f 1) -fi set -e -/usr/lib/qubes/qrexec-client-vm $VM qubes.Filecopy /usr/lib/qubes/qfile-agent "$@" +. qvm-copy-to-vm "$@" rm -rf "$@" From 160b05756b2f3a62dcf5f445798fb311b6b7bc2f Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Sat, 13 Feb 2016 15:22:35 +0000 Subject: [PATCH 2/3] qvm-move-to-vm: Use '--' before file arguments --- qubes-rpc/qvm-move-to-vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubes-rpc/qvm-move-to-vm b/qubes-rpc/qvm-move-to-vm index 2212c38..7f8050b 100755 --- a/qubes-rpc/qvm-move-to-vm +++ b/qubes-rpc/qvm-move-to-vm @@ -22,4 +22,4 @@ set -e . qvm-copy-to-vm "$@" -rm -rf "$@" +rm -rf -- "$@" From c73034003941b3c816955e8eebfb06d7246fa973 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Tue, 16 Feb 2016 08:34:06 +0000 Subject: [PATCH 3/3] Use && in qvm-move-to-vm && is safer in case qvm-*copy*-to-vm is ever changed to call 'set +e'. --- qubes-rpc/qvm-move-to-vm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qubes-rpc/qvm-move-to-vm b/qubes-rpc/qvm-move-to-vm index 7f8050b..4c0a52c 100755 --- a/qubes-rpc/qvm-move-to-vm +++ b/qubes-rpc/qvm-move-to-vm @@ -20,6 +20,5 @@ # # -set -e -. qvm-copy-to-vm "$@" +. qvm-copy-to-vm "$@" && rm -rf -- "$@"