Package: aspell, dictionaries-common
Version: 0.60.5.2-2
Severity: normal
Tags: patch


Hi, this is a suggestion regarding the aspell
installation/configuration stage.

I have some stuff in my $HOME/.aspell.conf that prevents
/usr/bin/aspell from running correctly as root.  When
installing/upgrading/configuring aspell via 'sudo apt-get'
or 'sudo dpkg-reconfigure', $HOME is /home/username instead
of /root or empty.  Therefore config breaks.

The first patch below unsets $HOME in aspell.postinst; this
fixes the problem when aspell-autobuildhash is called by
aspell's postinst configure, which I used to verify that
$HOME is indeed the problem.  Here's how I tested it:
     
    echo 123 | sudo tee /var/lib/aspell/en.compat
    mkdir /tmp/aspell.conf.test
    echo junk > /tmp/aspell.conf.test/.aspell.conf
    HOME=/tmp/aspell.conf.test sudo dpkg-reconfigure aspell

aspell-autobuildhash probably shouldn't be using any
personal configuration since it's updating system-wide
files.  So I suspect the right solution would be to modify
aspell-autobuildhash thus.  The second patch below adds
--per-conf=/dev/null to the aspell commandline and also
works for me.

Thanks,
Karl

P.S. Maybe dpkg shouldn't be letting $HOME through at all?

--- aspell.postinst.orig        2008-05-19 15:03:18.000000000 -0700
+++ aspell.postinst     2008-05-19 15:07:38.000000000 -0700
@@ -4,6 +4,6 @@
 
 if [ "$1" = "configure" ] ; then
     if [ -x /usr/sbin/aspell-autobuildhash ]; then
-        aspell-autobuildhash
+        HOME= aspell-autobuildhash
     fi
 fi


--- aspell-autobuildhash.orig   2008-05-19 15:34:24.000000000 -0700
+++ aspell-autobuildhash        2008-05-19 15:35:15.000000000 -0700
@@ -73,6 +73,7 @@
     my $options   = "";
 
     $options      = "--dont-validate-affixes" unless $debug;
+    $options .= " --per-conf=/dev/null";
 
     myerror "aspell data dir $data does not exist" unless ( -d $data );
 



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to