How to detect portupgrade and barf

Brooks Davis brooks at one-eyed-alien.net
Tue Oct 11 09:21:39 PDT 2005


On Tue, Oct 11, 2005 at 09:46:37AM +0100, Nick Hilliard wrote:
> > Do what needs to be done in the deinstall script of the package.  If you
> > can't do that for some reason, you must find a way to have them both
> > installed at once that is supported by the ports collection.  Short
> > of some sort of new port per version scheme I don't see a way to do
> > that.
> 
> Hi Brooks,
> 
> Both old and new package will be installed in version specific
> directories, so no overlap will occur and the versions can be used and
> run simultaneously.
> 
> The problem is how to detect whether portupgrade is being used to run
> the pkg_delete, or whether pkg_delete is being run directly from the
> command line. Is this supported, or is there some good or recommended
> way of doing this?

There is no easy way to do this and doing it won't really solve the
problem because it won't prevent people from doing the same thing
manually.  The problem is that this port violates certain assumptions
of the ports infrastructure.  Hmm, one slightly evil thought occurs to
me.  Since the software installs in different directories each time,
what about copying the previous install into WRKDIR and reinstalling it
as part of the installation process?  Your plist would be odd, but it
might work.  Another option that would be more work but might be cleaner
since it could let you uninstall the old bits after upgrade would be a
special port that takes care of saving a copy of the old for you which
is a BUILD_DEPEND and INSTALL_DEPEND if and only if a previous install
exists.  It wouldn't prevent some types of foot shooting, but it would
insure that the following works:

make
make deinstall
make install

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20051011/2319bf9b/attachment.bin


More information about the freebsd-ports mailing list