Re: scores file - how to fix?
On Sun, Mar 01, 1998 at 01:02:06PM -0800, Joey Hess wrote:
> Adrian Bridgett wrote:
> > I've been looking at how to change my packages to conform to the "new"
> > standard. I was one of those nasty, bad people who tagged scores files as
> > conffiles. I believe this is how to fix it:
> >
> > preinst: when called with "upgrade old-version", check to see if the
> > old-version was a "broken" package. If it was, copy the
> > scores to a temporary location (e.g. "cp $SCORE $SCORE.tmp" )
> >
> > postinst: if $SCORE.tmp exists, "mv $SCORE.tmp $SCORE". Always do
> > "touch $SCORE; chown root.games $SCORE; chmod 0664 $SCORE"
> >
> > This should keep the old scores around if they exist. It always creates a
> > scores file with the correct permissions.
>
> This isn't necessary. All you need is:
>
> postinst: touch $SCORE; chown root.games $SCORE; chmod 0664 $SCORE
>
> This works because if you change a package so a conffile does not exist in
> the package anymore, dpkg leaves the conffile in place when you upgrade.
Oh - I never knew that, I also can't see any mention of that behaviour in
the dpkg packaging manual. So *any* package which stops including a conffile
must delete it itself somewhere?!
> Note that you also need:
>
> postrm (on purge only): rm -f $SCORE; (delete the directory tree $SCORE was in)
I think I mentioned that in an earlier follow-up - which has only just been
sent since I'm on dialup and so my mail is queued for almost a day before
being sent :-(
> You have to delete the directory tree because dpkg has already tried and
> failed to remove it by this point, and will not try again.
Yeah - I tried this just incase it worked (since sometimes "cannot remove
directory ... not empty" are 'untrue' since it deletes them later on).
Adrian
email: adrian.bridgett@poboxes.com | Debian Linux - www.debian.org
http://www.poboxes.com/adrian.bridgett | Because bloated, unstable
PGP key available on public key servers | operating systems are from MS
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: