diff options
author | Chris Gianelloni <wolf31o2@gentoo.org> | 2006-03-13 17:00:21 +0000 |
---|---|---|
committer | Chris Gianelloni <wolf31o2@gentoo.org> | 2006-03-13 17:00:21 +0000 |
commit | 9db22f722c9d88f0b3a37ef70c466ac7a2605f3c (patch) | |
tree | 8b896049f96be4c94a2a6653573c35b014d74708 /bin | |
parent | look for minors out of order instead of disk position (diff) | |
download | gli-9db22f722c9d88f0b3a37ef70c466ac7a2605f3c.tar.gz gli-9db22f722c9d88f0b3a37ef70c466ac7a2605f3c.tar.bz2 gli-9db22f722c9d88f0b3a37ef70c466ac7a2605f3c.zip |
Added bash scripts, icons, and desktop entries from the ebuild to make my life easier.
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/gli/trunk@1362 f8877401-5920-0410-a79b-8e2d7e04ca0d
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/installer | 108 | ||||
-rwxr-xr-x | bin/installer-dialog | 8 | ||||
-rwxr-xr-x | bin/installer-gtk | 9 |
3 files changed, 125 insertions, 0 deletions
diff --git a/bin/installer b/bin/installer new file mode 100755 index 0000000..34a5f59 --- /dev/null +++ b/bin/installer @@ -0,0 +1,108 @@ +#!/bin/bash +# +# $Header: /var/cvsroot/gentoo/src/installer/bin/installer,v 1.1 2006/03/13 17:00:21 wolf31o2 Exp $ +# +# This is the installer script that we will use to determine whether or not +# we are running in X or as root. A good portion of this script was ripped +# from the loki_setup setup.sh script, as it already did most of what I was +# looking to do. + +installer_root=/opt/installer + +# Allow X +xhost + 2>/dev/null + +# patching utf-8 locales +if test ! ${UTF8FIX} ; then +LANG=`echo ${LANG} | sed 's/[\@\.].*$//'` +fi + +# Go to the proper setup directory (if not already there) +#cd `dirname $0` +cd $installer_root/bin + +# call installer with -auth when ran through su/xsu/sudo +auth=0 +if [ "$1" = "-auth" ]; then + auth=1 + shift +fi + +# Find the installation program +# try_run INSTALLER_NAME [PARAMETERS_PASSED] +# INSTALLER_NAME: installer-gtk or installer-dialog +# PARAMETERS_PASSED: additional arguments passed to the setup script +try_run() { + setup=$1 + shift + + failed=0 + "$setup" "$@" 2>/dev/null + failed="$?" + return "$failed" +} + +if [ "$auth" -eq 0 ]; then + GOT_ROOT=`id -u` + if [ "$GOT_ROOT" != "0" ]; then + # first we try sudo + try_run /usr/bin/sudo env DISPLAY=":0.0" su -c "$installer_root/bin/installer -auth" + status="$?" + if [ "$status" -eq 0 ]; then + exit 0 + elif [ "$status" -eq 1 ]; then + try_run /usr/bin/gnomesu -u root -c "sh $installer_root/bin/installer -auth" + status="$?" + # If try_run successfully executed gnomesu, it will return gnomesu's + # exit code. + if [ "$status" -eq 0 ]; then + exit 0 + elif [ "$status" -eq 1 ]; then + try_run /usr/bin/xsu -e -a -u root -c "sh $installer_root/bin/installer -auth" + status="$?" + # xsu returns 2 if ran and cancelled (i.e. the user 'doesn't + # want' to auth). it will return 0 if the command was executed + # correctly + # summing up, if we get 1, something failed + if [ "$status" -eq 0 ]; then + exit 0 + elif [ "$status" -eq 1 ]; then + # xsu wasn't found, or failed to run + # if xsu actually ran and the auth was cancelled, + # $status is 2 + echo "You need to run this installation as the super user." + echo "Please enter the root password." + try_run /bin/su root -c "export DISPLAY=$DISPLAY;sh $installer_root/bin/installer -auth" + status="$?" + if [ "$status" -eq 0 ]; then + # the auth command was properly executed + exit 0 + else + exit 1 + fi + elif [ "$status" -eq 3 ]; then + # the auth failed or was canceled + # we don't want to even start the setup if not root + echo "Please run this installation as the super user" + exit 1 + fi + elif [ "$status" -eq 3 ]; then + echo "Please run this installation as the super user" + exit 1 + fi + fi + fi +fi + +# Try to run the installer +try_run /usr/bin/installer-gtk $args $* +status=$? +if [ $status -eq 1 ]; then + try_run /usr/bin/installer-dialog $args $* || { + if [ $status -ne 2 ]; then + echo "The setup program seems to have failed" + fi + status=1 + } +fi +exit $status diff --git a/bin/installer-dialog b/bin/installer-dialog new file mode 100755 index 0000000..e6bbc7d --- /dev/null +++ b/bin/installer-dialog @@ -0,0 +1,8 @@ +#!/bin/bash + +INSTALL_DIR=/opt/installer +export PYTHONPATH="${INSTALL_DIR}" + +cd ${INSTALL_DIR}/fe/dialog +./gli-dialog.py + diff --git a/bin/installer-gtk b/bin/installer-gtk new file mode 100755 index 0000000..8c1ce25 --- /dev/null +++ b/bin/installer-gtk @@ -0,0 +1,9 @@ +#!/bin/bash + +INSTALL_DIR=/opt/installer +export PYTHONPATH="${INSTALL_DIR}" + +cd ${INSTALL_DIR}/fe/gtk +./gtkfe.py + + |