Package: dictionaries-common
Version: 1.11.5
Severity: normal
Tags: patch

Hi!

The ispell-autobuildhash script leaves a /tmp/ispell-auto.stat when
finished. The problem comes from how buildhash infers the basename
of the stat file, in this case the dictionary is inside a
/tmp/ispell-auto.XXXXXX tempdir, and the filename is dictname-mwl,
which makes buildhash use the containing directory as the basename,
with the .XXXXXX removed, instead of dictname, and the cleanup handler
only removes the tmepdir. The attached patch switched to dictname.mwl
to fix this.

thanks,
guillem
From dda67a0b50395eb4486d913966cd91b1a8e9e6f2 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Thu, 25 Aug 2011 00:14:10 +0200
Subject: [PATCH] Do not leave around a /tmp/ispell-auto.stat file
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Because the basename is /tmp/ispell-auto.XXXXXX/DICT-mwl, buildhash
uses “/tmp/ispell-auto.” as the basename instead of
“/tmp/ispell-auto.XXXXXX/DICT”, rename DICT-mwl to DICT.wml to make
sure the stat file is placed under the temporary directory and as
such removed on the cleanup handler.
---
 scripts/system/ispell-autobuildhash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/system/ispell-autobuildhash b/scripts/system/ispell-autobuildhash
index 9b653ab..86b976d 100755
--- a/scripts/system/ispell-autobuildhash
+++ b/scripts/system/ispell-autobuildhash
@@ -112,7 +112,7 @@ sub autorebuild {
 
   print STDERR "ispell-autobuildhash: Processing \'$dict\' dict.\n";
 
-  my $tempfile = "$tmpdir/$dict-mwl";
+  my $tempfile = "$tmpdir/$dict.mwl";
   if ( -e $aff ){
     if ( -e $zmwl ){
       my $gzip_cmd  = "gzip -dc $zmwl > $tempfile";
-- 
1.7.5.4

Reply via email to