]> git.pld-linux.org Git - packages/VirtualBox.git/blame - wrapper.patch
- rel 2
[packages/VirtualBox.git] / wrapper.patch
CommitLineData
a757042e
JR
1--- VirtualBox-5.1.14/src/VBox/Installer/linux/VBox.sh.orig 2017-02-03 07:40:16.928172726 +0100
2+++ VirtualBox-5.1.14/src/VBox/Installer/linux/VBox.sh 2017-02-03 07:42:41.247214271 +0100
3@@ -21,6 +21,7 @@
4 # works on Solaris and OS X.
5 TARGET=`readlink -e -- "${0}"` || exit 1
6 MY_DIR="${TARGET%/[!/]*}"
7+APP=`basename $0`
8
9 # (
10 # path="${0}"
11@@ -40,14 +41,31 @@
d19b622b
JP
12 # test -n "${path}" || pwd
13 # done
14 # )
15+
753cf356
ER
16+show_message() {
17+ local BINFILE=${0##*/} message
18+
4a1bc376
ER
19+ if [ "$DESKTOP" = "kde" ]; then
20+ message=$(cat)
21+ PATH=$(kde4-config --path exe) kdialog --sorry "$message"
22+ elif [ -n "$DISPLAY" ] && [ -x /usr/bin/gxmessage ]; then
753cf356
ER
23+ gxmessage --center --buttons GTK_STOCK_OK -wrap -geometry 400x150 -name $BINFILE -file -
24+ elif [ -n "$DISPLAY" ] && [ -x /usr/bin/zenity ]; then
25+ message=$(cat)
26+ zenity --error --icon-name=virtualbox --text "$message"
27+ else
28+ cat >&2
29+ fi
30+}
31+
753cf356 32
a757042e
JR
33-if test -f /usr/lib/virtualbox/VirtualBox &&
34- test -x /usr/lib/virtualbox/VirtualBox; then
35+if test -f "/usr/lib/virtualbox/${APP}" &&
36+ test -x "/usr/lib/virtualbox/${APP}"; then
37 INSTALL_DIR=/usr/lib/virtualbox
38-elif test -f "${MY_DIR}/VirtualBox" && test -x "${MY_DIR}/VirtualBox"; then
39+elif test -f "${MY_DIR}/${APP}" && test -x "${MY_DIR}/${APP}"; then
d19b622b
JP
40 INSTALL_DIR="${MY_DIR}"
41 else
42- echo "Could not find VirtualBox installation. Please reinstall."
43+ echo "Could not find VirtualBox installation. Please reinstall." | show_message
44 exit 1
45 fi
46
a757042e 47@@ -57,7 +75,7 @@
753cf356
ER
48 if [ "$1" = "shutdown" ]; then
49 SHUTDOWN="true"
50 elif ! lsmod|grep -q vboxdrv; then
51- cat << EOF
52+ show_message << EOF
53 WARNING: The vboxdrv kernel module is not loaded. Either there is no module
54 available for the current kernel (`uname -r`) or it failed to
55 load. Please recompile the kernel module and install it by
a757042e 56@@ -67,7 +85,7 @@
753cf356
ER
57 You will not be able to start VMs until this problem is fixed.
58 EOF
59 elif [ ! -c /dev/vboxdrv ]; then
60- cat << EOF
61+ show_message << EOF
62 WARNING: The character device /dev/vboxdrv does not exist. Try
63
d19b622b 64 sudo /sbin/vboxconfig
a757042e 65@@ -79,7 +97,7 @@
753cf356
ER
66 fi
67
68 if [ -f /etc/vbox/module_not_compiled ]; then
69- cat << EOF
70+ show_message << EOF
71 WARNING: The compilation of the vboxdrv.ko kernel module failed during the
72 installation for some reason. Starting a VM will not be possible.
73 Please consult the User Manual for build instructions.
a757042e
JR
74@@ -105,7 +123,6 @@
75 exit 0
76 fi
77
78-APP=`basename $0`
79 case "$APP" in
80 VirtualBox|virtualbox)
81 exec "$INSTALL_DIR/VirtualBox" "$@"
This page took 0.038494 seconds and 4 git commands to generate.