Fix kdialog --progressbar usage

Returned dbus reference is multi-word string, it was not quoted on
purpose. ShellCheck was wrong about it.

QubesOS/qubes-issues#3449
这个提交包含在:
Marek Marczykowski-Górecki 2018-01-08 02:25:59 +01:00
父节点 a8aa41e040
当前提交 7d82029aec
找不到此签名对应的密钥
GPG 密钥 ID: 063938BA42CFA724
共有 2 个文件被更改,包括 12 次插入6 次删除

查看文件

@ -22,7 +22,8 @@
if command -v kdialog 2> /dev/null; then
SIZE=$(du --apparent-size -c -- "$@" 2> /dev/null | tail -1 | cut -f 1)
REF=$(kdialog --progressbar "Copy progress")
qdbus "$REF" org.freedesktop.DBus.Properties.Set "" maximum "$SIZE"
# shellcheck disable=SC2086
qdbus $REF org.freedesktop.DBus.Properties.Set "" maximum "$SIZE"
export PROGRESS_TYPE=gui
@ -31,10 +32,12 @@ if command -v kdialog 2> /dev/null; then
/usr/lib/qubes/qfile-agent "$@" |
(while read -r sentsize ; do
CURRSIZE=$((sentsize / 1024))
qdbus "$REF" org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE"
# shellcheck disable=SC2086
qdbus $REF org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE"
done)
qdbus "$REF" close
# shellcheck disable=SC2086
qdbus $REF close
# we do not want a dozen error messages, do we
# if ! [ "x"$agentstatus = xDONE ] ; then
# kdialog --sorry 'Abnormal file copy termination; see /var/log/qubes/qrexec.xid.log in dom0 for more details'

查看文件

@ -25,7 +25,8 @@ if type kdialog 2> /dev/null; then
SIZE=$(du --apparent-size -c -- "$@" 2> /dev/null | tail -1 | cut -f 1)
REF=$(kdialog --progressbar "Move progress")
qdbus "$REF" org.freedesktop.DBus.Properties.Set "" maximum "$SIZE"
# shellcheck disable=SC2086
qdbus $REF org.freedesktop.DBus.Properties.Set "" maximum "$SIZE"
export PROGRESS_TYPE=gui
@ -34,14 +35,16 @@ if type kdialog 2> /dev/null; then
/usr/lib/qubes/qfile-agent "$@" |
(while read -r sentsize ; do
CURRSIZE=$((sentsize / 1024))
qdbus "$REF" org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE"
# shellcheck disable=SC2086
qdbus $REF org.freedesktop.DBus.Properties.Set "" value "$CURRSIZE"
done)
# shellcheck disable=SC2181
if [ $? -eq 0 ]; then
rm -rf "$@"
fi
qdbus "$REF" close
# shellcheck disable=SC2086
qdbus $REF close
# we do not want a dozen error messages, do we
# if ! [ "x"$agentstatus = xDONE ] ; then
# kdialog --sorry 'Abnormal file copy termination; see /var/log/qubes/qrexec.xid.log in dom0 for more details'