--- trunk/core/include/mozilla.sminc 2009/07/12 16:43:44 2863 +++ trunk/include/mozilla.sminc 2013/11/26 11:58:19 20234 @@ -69,16 +69,23 @@ msetpref() { - : ${MOZILLA_PREF_CONFIG="magellan.js"} - : ${MOZILLA_PREF_PATH="/usr/$(mlibdir)/mozilla-firefox/defaults/pref"} - local pref - local value + : ${MOZILLA_PREF_CONFIG="01-magellan.js"} + case ${PNAME} in + *firefox*) : ${MOZILLA_PREF_PATH="/usr/$(mlibdir)/${PNAME}/browser/defaults/preferences"} ;; + *thunderbird*) : ${MOZILLA_PREF_PATH="/usr/$(mlibdir)/${PNAME}/defaults/preferences"} ;; + esac + local pref="$1" + local value="$2" [[ -z ${pref} ]] && die "msetpref(): no \$pref given" if [[ ${pref} = --init ]] then # only create an empty config + if [[ ! -d ${BINDIR}/${MOZILLA_PREF_PATH} ]] + then + install -d ${BINDIR}/${MOZILLA_PREF_PATH} || die + fi :> ${BINDIR}/${MOZILLA_PREF_PATH}/${MOZILLA_PREF_CONFIG} || die else # write a pref value @@ -105,6 +112,6 @@ # eg: # pref("general.useragent.vendor","Magellan-Linux"); - echo "pref(\"${pref}\",${value});" >> ${BINDIR}/${MOZILLA_PREF_PATH}/${MOZILLA_PREF_CONFIG} || die + echo "pref(\"${pref}\", ${value});" >> ${BINDIR}/${MOZILLA_PREF_PATH}/${MOZILLA_PREF_CONFIG} || die fi }