Re: scores file - how to fix?
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.
Note that you also need:
postrm (on purge only): rm -f $SCORE; (delete the directory tree $SCORE was in)
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.
see shy jo
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to email@example.com .