# copy profile from Thunderbird if its available and if no Icedove
# profile exists
-if [ ! -d $HOME/.icedove ]; then
- if [ -d $HOME/.thunderbird ]; then
- echo "Copying profile from Thunderbird"
- cp -rf $HOME/.thunderbird $HOME/.icedove
- fi
+if [ ! -d $HOME/.icedove ] && [ -d $HOME/.thunderbird ]; then
+ echo "Copying profile from Thunderbird"
+ cp -a $HOME/.thunderbird $HOME/.icedove
fi
-MOZARGS=
-MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \
- sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
-for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
- eval MOZLANG="$(echo $MOZLANG | sed -e "s|_\([^.]*\).*|-\1|g")"
-
- if [ -f $LIBDIR/chrome/$MOZLANG.jar ]; then
- MOZARGS="-UILocale $MOZLANG"
- break
+# compreg.dat and/or chrome.rdf will screw things up if it's from an
+# older version. http://bugs.gentoo.org/show_bug.cgi?id=63999
+for f in ~/.icedove/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do
+ [ -f "$f" ] || continue
+ if [ "$f" -ot "$0" ] || [ "$f" -ot "$LIBDIR/components/compreg.dat" ]; then
+ echo "Removing $f leftover from older Icedove"
+ rm -f "$f"
fi
done
-if [ -z "$MOZARGS" ]; then
- # try harder
- for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
- eval MOZLANG="$(echo $MOZLANG | sed -e "s|_.*||g")"
-
- LANGFILE=$(echo ${MOZILLA_FIVE_HOME}/chrome/${MOZLANG}*.jar \
- | sed 's/\s.*//g' )
- if [ -f "$LANGFILE" ]; then
- MOZLANG=$(basename "$LANGFILE" | sed 's/\.jar//')
- MOZARGS="-UILocale $MOZLANG"
- break
- fi
- done
-fi
-
-if [ -n "$MOZARGS" ]; then
- ICEDOVE="$LIBDIR/icedove $MOZARGS"
-else
- ICEDOVE="$LIBDIR/icedove"
-fi
+ICEDOVE="$LIBDIR/icedove"
-if [ "$1" == "-remote" ]; then
- $ICEDOVE "$@"
+if [ "$1" = "-remote" ]; then
+ exec $ICEDOVE "$@"
else
- PING=`$ICEDOVE -remote 'ping()' 2>&1 >/dev/null`
+ PING=$($ICEDOVE -remote 'ping()' 2>&1 >/dev/null)
if [ -n "$PING" ]; then
- $ICEDOVE "$@"
+ exec $ICEDOVE "$@"
else
case "$1" in
- -compose|-editor)
- $ICEDOVE -remote 'xfeDoCommand (composeMessage)'
+ -compose|-editor)
+ exec $ICEDOVE -remote 'xfeDoCommand (composeMessage)'
;;
- *)
- $ICEDOVE -remote 'xfeDoCommand (openInbox)'
+ *)
+ exec $ICEDOVE -remote 'xfeDoCommand (openInbox)'
;;
esac
fi