]> git.donarmstrong.com Git - neurodebian.git/commitdiff
BF: use SUDO_ASKPASS + sudo (do not use gksu for a variety of reasons)
authorYaroslav Halchenko <debian@onerussian.com>
Wed, 6 Oct 2010 16:55:53 +0000 (12:55 -0400)
committerYaroslav Halchenko <debian@onerussian.com>
Wed, 6 Oct 2010 16:55:53 +0000 (12:55 -0400)
debian/control
tools/nd-autoinstall

index 6f3aa035e127b062f3360015e82691dd90a3d213..db9519d3f4df02bfee58ccc3a1879d26e31f3f61 100644 (file)
@@ -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
index 2b5e2b4f0b3a918a8707eed082959ac406a2b856..f98edda8ae28dfdb7c86972ddff1c00c749f8953 100755 (executable)
@@ -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" \