Re: <pkg>-byte
On Sun, Dec 22, 2002 at 05:28:01PM +0100, Jérôme Marant wrote:
> 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.
So, this would be only for existing -byte packages, right ?
> >> 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
Mmm, it should no be necessary to move it, i could remove it all the
same, since i _know_ that /usr/share/doc/spamoracle-byte belongs to
spamoracle-byte, and is part of the package i am installing.
What about just :
1) in preinst, we check that the version we are _upgrading_ from is
less than one supporting the symlink. If this is the case, we simply
remove the directory, provided it is empty, as it should be since we
removed the files from the previous version, right ? If it is not
empty, we can tell the user that with a debconf note, and move it to
/usr/share/doc/spamoracle-byte.old or something such.
2) there is no 2, we have the symlink in the new package, it get
installed and that is the end of it.
Friendly,
Sven Luther
Reply to: