ASPELL-AUTOBUILDHASH(8)

πŸ’– ASPELL-AUTOBUILDHASH πŸ’–

okay bestie, gather round, because this is the aspell-autobuildhash page from section 8 of the manual, and it's lowkey one of those scripts that just quietly does its thing so your spellchecker works. no cap.


✨ NAME ✨

aspell-autobuildhash β€” autobuilding aspell hash files for some dicts πŸŽ€


🌸 SYNOPSIS 🌸

aspell-autobuildhash [--force]

  Options:
   --debug      Show extra info about aspell-autobuildhash
                internal work.
                Will also enable aspell affix validation.
   --dry-run    Show what would be done, but do nothing real.
   --force      Rebuild the hash file for all dicts providing a
                compat file skipping the test.
   --triggered  Tell the script that is run in the triggers stage.

πŸ¦‹ DESCRIPTION πŸ¦‹

So aspell-autobuildhash is a script that manages the whole autobuild situation for aspell hash files, and it's literally meant to be called from the dictionaries-common tools. πŸ’…

Here's the vibe: it peeks at the aspell compatibility level, and it peeks at the compatibility level that the hash file was built with (if there even is a hash file), and then it decides whether the hash needs to be rebuilt or not. that's the whole personality.

heads up though β€” this script will only work on aspell packages that were actually prepared to use it. for any other aspell dict package it just... does nothing. sits there. vibes. πŸ™ˆ

πŸ’œ OPTIONS πŸ’œ

  • --debug β€” spills some extra tea about aspell-autobuildhash's internal work. also turns on aspell affix validation, so that's a two-for-one. ✨
  • --dry-run β€” shows you what would be done, but does nothing real. window shopping, basically. πŸ›οΈ
  • --force β€” rebuilds the hash file for all dicts that provide a compat file, regardless of the compatibility levels found. no questions asked.
  • --triggered β€” tells the script that it's being run in the triggers stage.
    • When it's running under dpkg control, it will not try to set the aspell-autobuildhash trigger, and instead runs the real aspell-autobuildhash code.
    • When it's not running under dpkg control, the real code runs always anyway, and --triggered has no real effect. it's giving decorative. πŸ’€

πŸ‘‘ PACKAGE MAINTAINERS πŸ‘‘

listen up, maintainers, this part is for you 🫢

To use this whole system, aspell-autobuildhash expects a $lang.compat file sitting in /var/lib/aspell (and yes, $lang is the lang basename with the variant if there is one β€” so $lang is something like gl-minimos or en). That file should contain the aspell compatibility version for the last successful build, or "0", or it can be an empty file if the hash is to be rebuilt β€” which is exactly the situation for dictionary installation and upgrades.

When upgrading aspell, the script checks whether the version in $lang.compat is different from aspell.compat, and rebuilds if it is, updating $lang.compat with the new value. slay. πŸ’…

Wordlists should already be compressed before all this β€” either with gzip (and their extensions set as .mwl.gz or .wl.gz), or preferably first with aspell prezip and then gzipped (with the .cwl.gz extension). This applies both to plain wordlists and to munched wordlists (in the ispell way) if you use affix compression. πŸŽ€

If your package is going to provide a single hash, install the prezipped+gzipped wordlist as /usr/share/aspell/$lang.cwl.gz or, if prezip is not used, as /usr/share/aspell/$lang.mwl.gz.

If your package is going to provide more than one aspell hash for the same $lang, you'll need to place each compressed wordlist as e.g. /usr/share/aspell/$subdict.cwl.gz, plus the common $lang.compat as described above. Then create a /usr/share/aspell/$lang.contents file with the base names of the subdicts, one in a line. For English that will contain, amongst other possible lines:

en-common
en-variant_0
en-variant_1
en-variant_2
en_CA-w_accents-only

No need to use this file if a single hash is being created. πŸ™Œ

The dictionaries-common scripts will call this script internally and create a single hash file at /var/lib/ispell/$lang.rws, or hash files at /var/lib/ispell/$subdict.rws. You must set a symlink to that files from /usr/lib/aspell/$lang.rws or /usr/lib/aspell/$subdict.rws as appropriate.

Aspell dictionary packages using this script must make sure that $lang.compat is reset on every new install/upgrade, so the hash gets rebuilt. They must also make sure that $lang.compat and all of /var/lib/aspell/$lang.rws or /var/lib/aspell/$subdict.rws are removed on package removal. no leaving crumbs, bestie. 🧹

As of version 1.10, the installdeb-aspell script will understand the 'auto-compat' and 'auto-contents' fields in the $dict.info-aspell file to help with this by adding the needed debhelper snippets. Put the base name(s) of your compat and contents file(s) in that entry and carefully check the resulting maintainer scripts after build. πŸ‘€

note: you are no longer suggested to ship empty files at any of /var/lib/aspell/$lang.compat, /var/lib/aspell/$lang.rws or /var/lib/aspell/$subdict.rws β€” instead, explicitly create/update them on install and explicitly remove them on removal. periodt.

The aspell maintainer should also call this script from the package postinst. When comparing versions, it will get the aspell version from the file /usr/share/aspell/aspell.compat.


🌈 AUTHORS 🌈

Agustin Martin <agmartin@debian.org>


Copyright (C) 2004-2024 Agustin Martin <agmartin@debian.org>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.


okay that's the whole thing, you ate that πŸ’…βœ¨ this was ASPELL-AUTOBUILDHASH(8), source version 1.31.4, dated 2026-3-22 β€” and that's the sign-off, bestie, go rebuild some hashes πŸ¦‹πŸ’–

πŸ“¦ where this page comes from