In qvm-copy-to-vm{kde}, handle files with spaces correctly (ticket #2).

This commit is contained in:
Rafal Wojtczuk 2010-05-13 15:41:55 +02:00
parent e1efcf60b3
commit 87d0f3a481
2 changed files with 4 additions and 5 deletions

View File

@ -34,7 +34,7 @@ echo " received"
mount /mnt/outgoing mount /mnt/outgoing
VMNAME=$1 VMNAME=$1
shift shift
cp -v -a $* /mnt/outgoing cp -v -a "$@" /mnt/outgoing
#sometimes Dolphin lags a bit #sometimes Dolphin lags a bit
umount /mnt/outgoing || (sleep 1; umount /mnt/outgoing) || exit 1 umount /mnt/outgoing || (sleep 1; umount /mnt/outgoing) || exit 1
qubes_penctl send $VMNAME || exit 1 qubes_penctl send $VMNAME || exit 1

View File

@ -20,15 +20,14 @@
# #
# #
FILES="$*" VM=$(kdialog -inputbox "Enter the VM name to send files to:")
VM=$(kdialog -inputbox "Enter the VM name to send $FILE to:")
if [ X$VM = X ] ; then exit 0 ; fi if [ X$VM = X ] ; then exit 0 ; fi
DEST=/mnt/outgoing DEST=/mnt/outgoing
SIZE=$(du -c $FILES | tail -1 | cut -f 1) SIZE=$(du -c "$@" | tail -1 | cut -f 1)
REF=$(kdialog --progressbar "Copy progress") REF=$(kdialog --progressbar "Copy progress")
qdbus $REF org.freedesktop.DBus.Properties.Set "" maximum $SIZE qdbus $REF org.freedesktop.DBus.Properties.Set "" maximum $SIZE
FLAG=$(mktemp) FLAG=$(mktemp)
(qvm-copy-to-vm $VM $FILES ; rm $FLAG) & (qvm-copy-to-vm $VM "$@" ; rm $FLAG) &
while ! grep -q $DEST /proc/mounts && [ -f $FLAG ] ; do while ! grep -q $DEST /proc/mounts && [ -f $FLAG ] ; do
sleep 0.1 sleep 0.1
done done