--- /usr/portage/www-client/chromium/files/chromium-launcher.sh 2010-11-07 20:07:27.000000000 +0100 +++ /usr/portage/www-client/chromium/files/chromium-launcher.sh 2011-01-04 09:13:13.516308407 +0100 @@ -8,6 +8,7 @@ export CHROME_WRAPPER="`readlink -f "$0"`" PROGDIR="`dirname "$CHROME_WRAPPER"`" +PROGNAME="`basename "$0"`" case ":$PATH:" in *:$PROGDIR:*) @@ -19,7 +20,43 @@ ;; esac +usage () { + echo "$PROGNAME [--temp-profile] [options] [URL]" + echo + echo " -h or --help This help screen" + echo " --temp-profile Start with a new and temporary profile" +} + +want_temp_profile=0 +while [ $# -gt 0 ]; do + case "$1" in + -h | --help | -help ) + usage + exit 0 ;; + --temp-profile ) + want_temp_profile=1 + shift ;; + -- ) # Stop option processing + shift + break ;; + * ) + break ;; + esac +done + +if [ $want_temp_profile -eq 1 ] ; then + TEMP_PROFILE=`mktemp -d` + TEMP_PROFILE_FLAG="--user-data-dir=$TEMP_PROFILE" +fi + # Set the .desktop file name export CHROME_DESKTOP="chromium-chromium.desktop" -exec "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins "$@" +if [ $want_temp_profile -eq 0 ] ; then + exec "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins "$@" +else + # we can't exec here as we need to clean-up the temporary profile + "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins "$TEMP_PROFILE_FLAG" "$@" + rm -rf $TEMP_PROFILE +fi +