| Current Path : /proc/thread-self/root/bin/X11/ |
| Current File : //proc/thread-self/root/bin/X11/bcompare |
#!/bin/sh
BC_LIB=/usr/lib/beyondcompare
export BC_LIB
BC_PACKAGE_TYPE=deb_amd64
export BC_PACKAGE_TYPE
EXEC="$BC_LIB/BCompare"
if [ -n "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$BC_LIB:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$BC_LIB"
fi
#check to see if we have all of the shared libraries.
if ldd "$EXEC" | grep -q "not found" ; then
#if not then add our qt4 libraries in and see if that fixes problem
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BC_LIB/qt4"
if ldd "$EXEC" | grep -q "not found" ; then
echo Some Shared Libraries were not found
ldd "$EXEC"
exit 1
fi
fi
########################################
# initialize context menu action scripts for KDE 3.5
if [ "$KDE_FULL_SESSION" = "true" ] && [ -f "$BC_LIB/kde_context_menu" ] ; then
if [ "$KDE_SESSION_VERSION" != "4" ] && [ "$KDE_SESSION_VERSION" != "5" ]; then
mkdir -p "$HOME/.beyondcompare"
if [ -d "$HOME/.kde/share/apps/konqueror" ]; then
mkdir -p "$HOME/.kde/share/apps/konqueror/servicemenus"
fi
"$BC_LIB/kde_context_menu"
fi
fi
########################################
# execute the program
ARGS="";
while [ "$#" -gt 0 ]; do
ARGS=$ARGS" \"$1\""
shift 1
done
/bin/bash -c "exec -a $0 $EXEC $ARGS > /dev/null 2>&1" $0
########################################
# set exit code / wait on existing instance
EXIT=$?
if [ $EXIT = 99 ]; then
# detected existing instance of Beyond Compare
EXIT=`cat /tmp/BC4_.$$`
rm -f /tmp/BC4_.$$
fi
exit $EXIT