5 # need this for relative symlinks
6 while [ -h "$PRG" ] ; do
8 link
=`expr "$ls" : '.*-> \(.*\)$'`
9 if expr "$link" : '/.*' > /dev
/null
; then
12 PRG
=`dirname "$PRG"`"/$link"
16 DIRNAME
=`dirname $PRG`
18 tmp_DIRNAME1
=`cd $DIRNAME/..; pwd`
19 tmp_DIRNAME2
=`cd $DIRNAME; pwd`
21 if [ -d "$tmp_DIRNAME1/share" ]; then
23 DIRNAME
="$tmp_DIRNAME1"
24 LIBPREFIX
="$DIRNAME/lib/mysql-gui"
25 elif [ -d "$tmp_DIRNAME2/share" ]; then
26 # installed to /opt or something similar
27 DIRNAME
="$tmp_DIRNAME2"
30 echo "Data files not found. Please check your installation."
36 if [ -f "$LIBPREFIX/lib/pango.modules" ]; then
42 export MQB_DIR
="$DIRNAME"
43 export LD_LIBRARY_PATH
="$LIBPREFIX/lib:$LD_LIBRARY_PATH"
45 ### begin stuff needed for bundled gtk libraries
46 pangorc_path
=$LIBPREFIX/lib
/pangorc
47 gdkpixbuf_path
=$LIBPREFIX/lib
/gdk-pixbuf.loaders
48 pangomodules_path
=$LIBPREFIX/lib
/pango.modules
49 desktopfile_path
=$DIRNAME/MySQLQueryBrowser.desktop
51 if [ $bundled_deps -ne 0 ]; then
54 if test $arg = "--update-paths"; then
55 echo "Updating `basename $0` installation paths..."
56 old_prefix
=$
(grep ModuleFiles
$pangorc_path|
sed -e 's#.*=.\?\(/.*\)/lib/pango.modules#\1#')
59 # replace paths in our custom configuration files
60 for f
in $pangorc_path $gdkpixbuf_path $pangomodules_path $desktopfile_path; do
61 sed -e "s:$old_prefix:$new_prefix:g" $f > $f.bak
63 echo "Error updating files for new installation path."
64 echo "Please make sure `basename $0` is installed correctly and you have"
65 echo "proper write permissions in the installation directory."
70 echo "Error updating files for new installation path."
71 echo "Please make sure `basename $0` is installed correctly and you have"
72 echo "proper write permissions in the installation directory."
84 # if we're in a bundle, make sure the paths in the pango and gdk-pixbuf
86 export GDK_PIXBUF_MODULE_FILE
="$gdkpixbuf_path"
87 export PANGO_RC_FILE
="$pangorc_path"
88 export GTK_EXE_PREFIX
="$LIBPREFIX"
90 prefix
=$
(grep ModuleFiles
$pangorc_path|
sed -e 's#.*=.\?\(/.*\)/lib/pango.modules#\1#')
92 if ! [ -f "$prefix/lib/pango.modules" ]; then
95 The actual installation path of `basename $0` is different from the
96 expected one. Please run $0 --update-paths (as the root
97 user, if needed) to have the installation directory updated.
102 ### end stuff needed for bundled gtk libraries