]> git.pld-linux.org Git - packages/VirtualBox.git/blob - wrapper.patch
- teach wrapper to look for called binary instead of GUI
[packages/VirtualBox.git] / wrapper.patch
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 @@
12  #         test -n "${path}" || pwd
13  #     done
14  # )
15
16 +show_message() {
17 +       local BINFILE=${0##*/} message
18 +
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
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 +
32  
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
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  
47 @@ -57,7 +75,7 @@
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
56 @@ -67,7 +85,7 @@
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  
64             sudo /sbin/vboxconfig
65 @@ -79,7 +97,7 @@
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.
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.042439 seconds and 3 git commands to generate.