4 # restore location of opera dir for new opera to do automatic profile migration
5 # we used to setup OPERA_PERSONALDIR to use XDG config path
6 # but seems there's no way to tell new opera where to take old profile for
7 # migration than it's hardcoded $HOME/.opera
8 # so we move stuff back there before launching opera
10 DOT_DIR="$HOME/.opera"
11 XDG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/opera"
13 # skip if already migrated
14 if [ -e $XDG_DIR/Preferences ]; then
18 OPERA_PERSONALDIR=$DOT_DIR
19 if [ ! -d "$OPERA_PERSONALDIR/operaprefs.ini" ]; then
20 OPERA_PERSONALDIR=$XDG_DIR
23 if [ "$OPERA_PERSONALDIR" = "$DOT_DIR" ]; then
28 # if ~/.opera contains just OperaAutoupdateChecker.sqlite, remove it
29 rm -f $DOT_DIR/OperaAutoupdateChecker.sqlite
30 test -d "$DOT_DIR" && rmdir --ignore-fail-on-non-empty $DOT_DIR
32 # neither dir exists, nothing to do
33 if [ ! -d "$DOT_DIR" ] && [ ! -d $XDG_DIR ]; then
37 # if no dir, just move
38 if [ ! -d "$DOT_DIR" ]; then
43 # may attempt to figure which dir is newer and then rename
48 exec /usr/lib/opera/opera "$@"