if test x$DISPLAY = x; then echo "Eazel Installer requires X to be running." exit fi export="export DISPLAY botan_rice_candy" params="DISPLAY=$DISPLAY && botan_rice_candy=yum" # Check proxy settings if test x$http_proxy '!=' x; then export="$export http_proxy" params="$params && http_proxy=$http_proxy" fi # Figure out what is already installed PR1_TO_PR2=no if test -f /usr/bin/nautilus; then VERSION=`/usr/bin/nautilus --version` if [ "x$VERSION" = "xGnome nautilus 0.1.0" ]; then PR1_TO_PR2=yes fi fi if test "x$1" = "x--version" -o "x$1" = "x--build" -o "x$1" = "x--help"; then QUICK=yes fi # First time through? spam... if test "x$botan_rice_candy" = "x" -a "x$QUICK" '!=' "xyes"; then # blurp echo "" echo "Eazel Installer 1.0" echo "" if test "x$PR1_TO_PR2" = "xyes"; then echo "Your PR1 setttings will be moved to ~/.nautilus.pr2.backup..." echo "" fi fi if test $UID -ne 0 -a "x$QUICK" '!=' "xyes"; then echo "To use the Eazel installer, you need superuser (root) access to your system." echo "If you are prompted for your root password, please enter it to login as the" echo "superuser. The root password is used only on your local machine, and is not" echo "transmitted to Eazel or any other party." echo "" # Start xhost +localhost /bin/su -s /bin/sh -c "$params && $export && cd $PWD && echo Uncompressing... && /bin/sh $0 $* --user $USER" xhost -localhost # FIXME: this will only work if they didn't run as root. # Move config if test "x$PR1_TO_PR2" = "xyes"; then VERSION=`/usr/bin/nautilus --version` if test "x$VERSION" != "xGNOME nautilus 0.1.0"; then echo "Saving old settings..." mkdir -p $HOME/.nautilus.pr2.backup >& /dev/null mv -f $HOME/.nautilus $HOME/.nautilus.pr2.backup/ >& /dev/null mv -f $HOME/Nautilus $HOME/.nautilus.pr2.backup/ >& /dev/null mv -f $HOME/.gconf/apps/nautilus/ $HOME/.nautilus.pr2.backup/ >& /dev/null mv -f $HOME/.gconf/apps/eazel-trilobite/ $HOME/.nautilus.pr2.backup/ >& /dev/null fi fi exit else if test "x$botan_rice_candy" = "x"; then # running as root, or has "--{version|build|help}" command-line option # note that the --user option has to be of the '=' variety because of # a bug in popt. (if any of the user args use the '=' form, a final # non-'=' ['--user arg'] option silently corrupts argv.) /bin/sh -c "$params && $export && cd $PWD && /bin/sh $0 $* --user=$USER" exit fi fi