# Do not use $GETROOT (sudo) with aptitude update. Since Squeeze aptitude
# does not need root privileges to check for updates.
# Closes: #596723

diff -Naur apt-dater-0.8.4.orig//clients/debian/apt-dater-host apt-dater-0.8.4/clients/debian/apt-dater-host
--- apt-dater-0.8.4.orig//clients/debian/apt-dater-host	2010-04-25 10:41:53.000000000 +0200
+++ apt-dater-0.8.4/clients/debian/apt-dater-host	2010-09-25 09:36:56.000000000 +0200
@@ -176,12 +176,14 @@
     my %holds;
     my $pos = 0;
     my $DPKGARGS;
+    my $_GETROOT = $GETROOT;
 
     if($DPKGTOOL eq "apt-get") {
 	$DPKGARGS = "-q -s -f";
     }
     elsif($DPKGTOOL eq "aptitude") {
 	$DPKGARGS = "-v -y -q -s -f";
+	$_GETROOT = '';
     }
     else {
 	# unkown DPKG frontend - fallback to apt-get
@@ -189,8 +191,8 @@
 	$DPKGARGS = "-q -s -f";
     }
 
-    unless(open(HAPT, "$GETROOT $DPKGTOOL $DPKGARGS upgrade |")) {
-	print "\nADPERR: Failed to execute '$GETROOT $DPKGTOOL $DPKGARGS upgrade' ($!).\n";
+    unless(open(HAPT, "$_GETROOT $DPKGTOOL $DPKGARGS upgrade |")) {
+	print "\nADPERR: Failed to execute '$_GETROOT $DPKGTOOL $DPKGARGS upgrade' ($!).\n";
 	exit(1);
     }
     while(<HAPT>) {
