[Pkg-fonts-devel] Dropping defoma use in TTF/OTF font packages?

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Jan 7 15:07:44 UTC 2010


On 01/07/2010 03:09 AM, Josselin Mouette wrote:
> Le jeudi 07 janvier 2010 à 02:16 -0500, Daniel Kahn Gillmor a écrit :
>> Sorry to resurrect an old thread here, but i'm having trouble making use
>> of joss' advice here:
>>
>> On 11/10/2009 10:38 AM, Josselin Mouette wrote:
>>> packages which remove the call to dh_installdefoma need to
>>> add something like this in their preinst:
> 
>>> if [ "$1" = remove ] && dpkg --compare-versions "$2" lt-nl $VERSION;
> 
>> I'm having trouble understanding why the test is checking
>>
>>   [ "$1" = remove ]
>>
>> instead of
>>
>>   [ "$1" = upgrade ] || [ "$1" = install ]
>>
>> Isn't this operation relevant on upgrade/install, instead of on removal?
> 
> Of course, you are right.

OK, thanks for the feedback.  In case it's useful to anyone else
migrating away from defoma, what i finally came up with (for
ttf-fifthhorseman-dkg-handwriting) was:


---------------------

FIRST_VERSION_NO_DEFOMA=0.13-3
FILE=/etc/defoma/hints/ttf-fifthhorseman-dkg-handwriting.hints
if [ "$1" = upgrade ] || [ "$1" = install ] && dpkg --compare-versions "$2" lt-nl $FIRST_VERSION_NO_DEFOMA;
then
    if [ -x /usr/bin/defoma-font ]; then
        if [ "$1" = upgrade ]; then  # no need to defoma-font purge-all if we aren't upgrading
            defoma-font purge-all $FILE
        fi
    fi
    rm_conffile ttf-fifthhorseman-dkg-handwriting $FILE
fi

---------------------

Note that i needed to wrap the defoma-font purge-all line as well, 
so that i would properly handle the case where the sysadmin:

 0) installs an old defoma-ized version
 1) removes it, leaving conffiles
 2) installs a new non-defoma version

without that extra test, the final installation would fail with these error messages:


0 pip:~# dpkg --install /home/dkg/src/ttf-fifthhorseman-dkg-handwriting/ttf-fifthhorseman-dkg-handwriting_0.13-3_all.deb 
Selecting previously deselected package ttf-fifthhorseman-dkg-handwriting.
(Reading database ... 162374 files and directories currently installed.)
Unpacking ttf-fifthhorseman-dkg-handwriting (from .../ttf-fifthhorseman-dkg-handwriting_0.13-3_all.deb) ...
W: /usr/share/fonts/truetype/fifthhorseman/dkgIt.ttf: not registered.
W: /usr/share/fonts/truetype/fifthhorseman/dkgBd.ttf: not registered.
W: /usr/share/fonts/truetype/fifthhorseman/dkgBI.ttf: not registered.
W: /usr/share/fonts/truetype/fifthhorseman/dkg.ttf: not registered.
dpkg: error processing /home/dkg/src/ttf-fifthhorseman-dkg-handwriting/ttf-fifthhorseman-dkg-handwriting_0.13-3_all.deb (--install):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /home/dkg/src/ttf-fifthhorseman-dkg-handwriting/ttf-fifthhorseman-dkg-handwriting_0.13-3_all.deb
1 pip:~# 

hope this helps other folks with the migration.

Regards,

	--dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 891 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-fonts-devel/attachments/20100107/fd140303/attachment.pgp>


More information about the Pkg-fonts-devel mailing list