From: Yaroslav Halchenko Date: Wed, 6 Oct 2010 16:55:53 +0000 (-0400) Subject: BF: use SUDO_ASKPASS + sudo (do not use gksu for a variety of reasons) X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9b8b36d6af5402b7b6d4301d6dcbf8ea3614b157;p=neurodebian.git BF: use SUDO_ASKPASS + sudo (do not use gksu for a variety of reasons) --- diff --git a/debian/control b/debian/control index 6f3aa03..db9519d 100644 --- a/debian/control +++ b/debian/control @@ -30,7 +30,7 @@ Description: NeuroDebian development tools Package: neurodebian-desktop Architecture: all -Depends: ${misc:Depends} +Depends: ${misc:Depends}, ssh-askpass-gnome | ssh-askpass Suggests: Description: neuroscience research environment Pacifier diff --git a/tools/nd-autoinstall b/tools/nd-autoinstall index 2b5e2b4..f98edda 100755 --- a/tools/nd-autoinstall +++ b/tools/nd-autoinstall @@ -12,10 +12,6 @@ set -u nd_autoinstall_version=0.1 -# Not used atm -#ai_install_cmd="/usr/bin/gksudo '/usr/bin/aptitude install -y @PACKAGE@'" -#ai_install_cmd_terminal=no - # To be set by cmdline args ai_envfile= ai_package= @@ -133,30 +129,11 @@ if [ ! -z "$ai_envfile_failed" ] || ! which $ai_command >/dev/null; then fi print_verbose "Need to install $ai_package to run $ai_command" - #cmd=$ai_install_cmd - #[ "x$ai_install_cmd_terminal" = xyes ] \ -# && cmd="/usr/bin/xterm -e /bin/bash -c '$cmd'" - cmd="${ai_install_cmd//@PACKAGE@/$ai_package}" - #/usr/bin/gksudo "/usr/bin/aptitude install -y $ai_package" > /tmp/nd-autoinstall.log 2>&1 - # debconf has a nice debconf-apt-progress but it would require - # root access to each of commands for little benefit - # - # . /usr/share/debconf/confmodule - # debconf-apt-progress --start - # debconf-apt-progress --from 0 --to 100 -- apt-get -y install $ai_package - # debconf-apt-progress --from 45 --to 90 -- apt-get -y install kde - # debconf-apt-progress --from 90 --to 100 -- apt-get -y install xfce4 - # debconf-apt-progress --stop logfile=$(mktemp -u /tmp/nd-autoinstall-XXXXXX.log) - # * aptitude for some reason does not return fail exit code - # * bloody gksudo swallows all stderr output (#599233) :-/ - # So we just initiate it first to get the password - { /usr/bin/gksudo ls > /dev/null; } - # and then revert to sudo - # and enforce a GNOME front-end since otherwise things might go wrong - # and there is no way to enforce just some GUI frontend - { /usr/bin/sudo DEBIAN_FRONTEND=gnome /usr/bin/apt-get install -y $ai_package 2>&1 \ + + { SUDO_ASKPASS="/usr/bin/ssh-askpass" /usr/bin/sudo -A \ + DEBIAN_FRONTEND=gnome /usr/bin/apt-get install -y $ai_package 2>&1 \ && rm -f $logfile; } \ | tee $logfile \ | zenity --title="nd-autoinstall" \