Hallo Augustin,

thanks for the patch, look and feel of it is very good.
I also tried it on the modified aspell-it (just randomly picked pet
package to test piuparts-happy-dictionaries packaging) and the result
was as expected. 

However, when I disabled "auto-compat" by removing the line in
*.info-aspell something seems goes wrong:
The package then some creates a bogus hashfile name like
HASH(0x6e9848).rws  and the installed autoscripts looks like it would
ignore the disabled auto-compat. 
Also, the result is the same if a it.compat is provided in
$DESTDIR/var/lib/aspell or not. 
(I'll attach the Debian directory of aspell-it I used for the test; It
might be caused also my incomplete understanding of the packaging
procedure of dictionaries. Note that the "original" package as currently
in the archives builds perfeclty fine and is unaffected of the issue I
saw... its seems only to be broken with dh_aspell-simple.)   

Talking about auto-compat, I think it would be anyway a good idea to
depreciate NOT using auto-compat or maybe even making it the default
behaviour: Installing the compiled *.rws and then rehashing it on e.g
aspell-updates will make debsums produce wrong warnings. 

Thinking about it, it maybe would be best if the dh_aspell-dimple would
indeed *fail* at build time if auto-compat is not enabled. This way, we
could keep backwars compatiblity for the installdeb-aspell interface but
enforce a better way of packaging on packages updated to use the new
interface.  

As said before, enabling auto-compat will work perfectly fine and result
is as expected, also debsums and piupart are happy.

I just have an additional suggestion, however this is just something
something "pedantic".
Currently installdeb-aspell also installs a (dangling) symlink when
auto-compat is turned on. Lintian does emit a experimental warning on
that. (e.g X: aspell-it: package-contains-broken-symlink)
My proposal would be to add a snippet to the preinst-compat and
postrm-compat scripts to create and delete the symlinks.
Please see the attached patch, but please be warned: Perl's not a
language I'm fluent in.


One plan for jessy would be to update the existings aspell-* packages
which are currently shipping the hashfiles. And as according to the
stocktaking I made, almost all of those would benefit of
dh_aspell-simple. (Exceptions are src:dutch, src:dsdo and
src:norwegian)  

To start the discussion e.g on debian-devel, dict-common-dev and with
the individual maintainers, can you maybe upload already the current
state to experimental, even if the docs are still incomplete?

Thanks!

--
Tobias Frost



Am Freitag, den 07.02.2014, 16:10 +0100 schrieb Agustin Martin:

> I was looking at this and am attaching a diff with the current status. 
> 
> I included an --aspell-simple option in installdeb-aspell which will enable
> postprocessing of an already 'make install'ed aspell official dictionary,
> including a debhelper sequence and a 'dh_aspell-simple' wrapper. $lang is 
> extracted from Makefile.pre and hash base names from already installed .rws
> files, removed after info collection. This info is used to properly install
> compressed .cwl files. Even tries to deal with multi-hash dicts.
> 
> This is the first time I deal with a debhelper sequence, hope nothing is
> wrong. Took some time to notice that it only accepts "dh_*" commands
> without options.
> 
> When looking at this, I am getting convinced that our current installdeb-*
> structure is becoming hard to maintain. It dealt originally with two very
> similar targets (ispell and wordlist), so "slice" was really useful and
> simple. But more and more stuff was added including aspell, hunspell and
> autobuildhash and has now become a bit messy. Need to find time to try
> putting things in a separate "DictionariesCommonDev" perl module so the
> real scripts become simpler and easier to maintain again and can be split
> easily if desired (pod section will greatly appreciate that). And use
> Dh_Lib functions to make everything more consistent.
> 
> Anyway, I have done some preliminary testing and seems to work well, but
> I need to test this more in depth. Also need to improve documentation, so
> upload will not be immediate.
> 
> Thanks for your suggestion and proposed changes. They were really useful
> when preparing these changes.
> 
> Regards,
> 

diff -Naur dictionaries-common_orig/scripts/debhelper/installdeb.in dictionaries-common/scripts/debhelper/installdeb.in
--- dictionaries-common_orig/scripts/debhelper/installdeb.in	2014-02-07 17:01:23.676496366 +0000
+++ dictionaries-common/scripts/debhelper/installdeb.in	2014-02-07 18:36:36.043091943 +0000
@@ -445,11 +445,11 @@
 
 	# Install extra auto-scripts for auto-compat handling
 	autoscript ($package, "preinst", "preinst-compatfile-$class",
-		    "s/#COMPAT#/$auto_compats/");
+		    "s/#COMPAT#/$auto_compats/;s/#HASHES#/$auto_hashes/");
 	autoscript ($package, "postinst", "postinst-compatfile-$class",
 		    "s/#COMPAT#/$auto_compats/");
 	autoscript ($package, "postrm", "postrm-varlibrm-$class",
-		    "s/#VARLIBRM#/$varlibrm/");
+		    "s/#VARLIBRM#/$varlibrm/;s/#HASHES#/$auto_hashes/");
 
 	# Make sure /var/lib/{a,i}spell directory is available.
 	doit ("install", "-d", $var_lib_dir);
@@ -460,10 +460,6 @@
 	  # Not for extra hashes only for the clean list
 	  next if ( defined $auto_extra_hash_basenames{$hash} );
 	  $hash = $hash . '.' .$hash_extension{$class};
-	  unless ( -e "$usr_lib_dir/$hash" ){
-	    print STDERR "$program: Setting \"$usr_lib_dir/$hash\" symlink.\n" if $debug;
-	    doit ("ln", "-sf", "/var/lib/$class/$hash", "$usr_lib_dir/$hash");
-	  }
 	}
       }
     }
diff -Naur dictionaries-common_orig/scripts/maintainer/postrm-varlibrm.in dictionaries-common/scripts/maintainer/postrm-varlibrm.in
--- dictionaries-common_orig/scripts/maintainer/postrm-varlibrm.in	2014-02-07 17:01:23.680496445 +0000
+++ dictionaries-common/scripts/maintainer/postrm-varlibrm.in	2014-02-07 18:41:29.355945209 +0000
@@ -1,8 +1,15 @@
 dico_class="[I:ispell:I][A:aspell:A]"
 dico_varlib_remove="#VARLIBRM#"
+dico_hashes="#HASHES#"
 
 case "$1" in abort-install|remove)
 	if [ -d "/var/lib/$dico_class" ]; then
 	    ( cd "/var/lib/$dico_class" && rm -f $dico_varlib_remove )
 	fi
+
+	for i in $dico_hashes; do
+	    if [ -h "/usr/lib/$dico_class/$i" ]; then
+	        rm -f "/usr/lib/$dico_class/$i"
+	    fi
+	done
 esac
diff -Naur dictionaries-common_orig/scripts/maintainer/preinst-compatfile.in dictionaries-common/scripts/maintainer/preinst-compatfile.in
--- dictionaries-common_orig/scripts/maintainer/preinst-compatfile.in	2014-02-07 17:01:23.680496445 +0000
+++ dictionaries-common/scripts/maintainer/preinst-compatfile.in	2014-02-07 18:41:02.299499121 +0000
@@ -1,8 +1,14 @@
 dico_class="[I:ispell:I][A:aspell:A]"
 dico_compat="#COMPAT#"
+dico_hashes="#HASHES#"
 
 [ -d "/var/lib/$dico_class" ] || mkdir -p "/var/lib/$dico_class"
 
 for i in $dico_compat; do
     >"/var/lib/$dico_class/$i"
 done
+
+for i in $dico_hashes; do
+   [ -e /usr/lib/$dico_class/$i ] || ln -s /var/lib/$dico_class/$i /usr/lib/$dico_class/$i 
+done
+

Attachment: aspell-it_2.4-20070901-0-2.1.debian.tar.xz
Description: application/xz-compressed-tar

Reply via email to