Major flaws of the new make deinstall code
sobomax at portaone.com
Mon Jul 14 11:39:47 PDT 2003
On Mon, Jul 14, 2003 at 02:23:46PM -0400, Joe Marcus Clarke wrote:
> On Mon, 2003-07-14 at 12:53, Maxim Sobolev wrote:
> > Folks,
> > I've noticed several misbehaviours of the new make deinstall code,
> > particularly:
> > 1. The new code behaves incorrectly when there are several @cwd
> > statements in the packing list. Particularly, it affects many
> > ports from games category, which usually create files and dirs
> > under /var. For some reason, make deinstall code takes the second
> > @cwd as the prefix of the installed package and obviously mismatch
> > happens. This needs to be corrected ASAP.
> Do you have a specific port in mind? I don't recall seeing this in
This is an in-house port for our product, pkg-plist looks like following:
@exec /bin/mkdir %D/log/radacc > /dev/null 2> /dev/null || /usr/bin/true
@unexec /bin/rmdir %D/log/radacc > /dev/null 2> /dev/null || /usr/bin/true
@unexec if cmp -s %D/db/raddb/clients %D/db/raddb/clients.sample; then rm -f %D/db/raddb/clients; fi
@exec [ -f %B/clients ] || cp %B/%f %B/clients
@unexec if cmp -s %D/db/raddb/naslist %D/db/raddb/naslist.sample; then rm -f %D/db/raddb/naslist; fi
@exec [ -f %B/naslist ] || cp %B/%f %B/naslist
For some reason, it picks /var from the installed package as a main
prefix resulting in false positive. I have not checked other ports
with multiple @cwd's though.
> > 2. In general, prefix-safety feature of make deinstall is misdesigned,
> > as it should not reject deinstalling package which has no dependants
> > (i.e. packages that depend on it) regardless of its prefix, as
> > replacing this package with one with a different prefix will not
> > lead to any problems I can think of.
> Replacing a dependency (pkgconfig, for example) with a version in a
> different prefix could have disasterous effects if you're dealing with
> files you expect to exist in a certain location. In any event, make
> deinstall-all will remove all packages with a given ORIGIN regardless of
> PKGNAME or PREFIX.
I am not talking about "replacing", but about deleting - deleting
package with different prefix should be harmless if no packages
depend on one being deleted.
> > -Maxim
> PGP Key : http://www.marcuscom.com/pgp.asc
More information about the freebsd-ports