[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Cleaning generated pk fonts in maintainer scripts (was: Bug#410158: lilypond-data: Wrong Pre-Depends)



Thomas Bushnell BSG <tb@becket.net> wrote:

> On Fri, 2007-02-09 at 07:42 +0100, Frank Küster wrote:
>> 
> No, it's kpsewhich.  I'm looking at the script.  It does not call
> mktexlsr; it does call kpsewhich, precisely to figure out the path in
> which the fonts are located, so that old files, installed by old
> versions, can be cleaned up.
>
> (That's why it's harmless to be missing the file, but I should probably
> determine after etch whether it needs to be reinstated.)

That is actually an interesting issue.  It's not been important or even
noticed, since the fonts in teTeX or TeXLive that are used as bitmap
fonts are mostly not developed any more.  This means they do not change
and you can use the generated pk bitmap fonts even if they were created
on potato.

>> Anyway, you might want to consider to use dh_installtex instead; it
>> safes you the hazzle of following changes in the TeX setup and just does
>> the right thing.  It's not in debhelper proper, but in tex-common, but
>> it follows debhelper conventions.
>
> I can't see how dh_installtex would help with the old preinst file,
> which is, btw, right there in the source. :)

dh_installtex can replace the code in lilypond-data.postinst, and add
the missing mktexlsr call to lilypond-data.postrm[1].  The preinst file I
didn't notice, since I was focused on lilypond-data.*.

I see that the code is both in the (unused) preinst and in
lilypond-data.postrm.  It's actually not clear to me whether preinst or
postrm is the best place to do this.  The argument "pro" preinst is that
one could check the old version, and only trigger the removal if we are
upgrading and the old version is older than the last change to the
fonts.  The arguments "pro" postrm are that you don't need a
Pre-Depends, and that file removal makes more sense in a removal script
and should also be done upon package removal, not only upgrade (as your
postrm script does, correctly).

However, things are not as easy as your script assumes. 

$ /usr/bin/kpsewhich -expand-var '$VARTEXFONTS'
/tmp/texfonts
$ ls `/usr/bin/kpsewhich -expand-var '$VARTEXFONTS'`
ls: /tmp/texfonts: No such file or directory
$ 

This setting is now only a fallback, and the fonts are stored in
per-user directories by default.  This was changed because of security
considerations (earlier with VARTEXFONTS actually used and in /var, any
TeX user could fill up the /var partition).

So if we have a package that changes sources for pk fonts, we could

- clean up the files in each $TEXMFVAR/fonts directory below /home/.
  I'm not sure this is a good idea, or even allowed by policy

- tell the admin (via debconf messages) that they should notify their
  users to remove the fonts.

Hm.

Regards, Frank

[1] should I report a separate bug on this?
-- 
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)



Reply to: