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

Re: <pkg>-byte



Sven Luther <luther@dpt-info.u-strasbg.fr> writes:
 
>> The problem:
>> 
>> If you have /usr/share/doc/spamoracle-byte directory in the current version
>> and if you replace it with a symlink in the next version of the package,
>> dpkg will not do such a replacement and leave the directory.
>
> Ok, i see.
>
> It would be no problem if i did the above from start, would it ?

Yes.

>> I have a trick in my icewm{-gnome} maintainer scripts that work this
>> around.
>
> What is the trick ? Make sure it is a symlink in a postinst ?

For icewm-gnome:

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

preinst:

case "$1" in
    install|upgrade)
        if [ -n "$2" ] && dpkg --compare-versions "$2" lt "1.0.8.6-1"
        then
            if [ -d /usr/share/doc/icewm-gnome ]; then
                mv /usr/share/doc/icewm-gnome \
                /usr/share/doc/icewm-gnome.moved-by-preinst
            fi
        fi
    ;;
esac


postinst:


if [ "$1" = "configure" ]; then
    rm -rf /usr/share/doc/icewm-gnome.moved-by-preinst
fi


postrm:

case $1 in
    abort-install|abort-upgrade)
        if [ -d /usr/share/doc/icewm-gnome.moved-by-preinst ]; then
            mv /usr/share/doc/icewm-gnome.moved-by-preinst \
               /usr/share/doc/icewm-gnome
        fi
        ;;
esac

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

I didn't find the trick myself. It comes from groff.

Cheers,

-- 
Jérôme Marant

http://marant.org



Reply to: