Subject: Re: pkg tools problem
To: Jeremy C. Reed <reed@reedmedia.net>
From: Alistair Crooks <agc@pkgsrc.org>
List: tech-pkg
Date: 02/07/2005 22:48:54
On Fri, Feb 04, 2005 at 03:40:26PM -0800, Jeremy C. Reed wrote:
> On Fri, 4 Feb 2005, Steven M. Bellovin wrote:
> 
> > ===> Installing for pkg_install-20050204
> > ===> pkg_install-20050106 is already installed - perhaps an older version?
> > *** If so, you may use either of:
> > ***  - "pkg_delete pkg_install-20050106" and "/usr/bin/make reinstall" to upgrade properly
> > ***  - "/usr/bin/make update" to rebuild the package and all of its dependencies
> > ***  - "/usr/bin/make replace" to replace only the package without re-linking
> > ***    dependencies, risking various problems.
> > *** Error code 1
> >
> >
> > I'm loathe to do a pkg_delete on pkg_install; beyond that, are the
> > instructions now wrong?  The machine I'm running on is -current.
> 
> My own pkg_install/Makefile has:
> +# Removing this package would break pkgsrc, so allow this package to
> +# reinstall over itself.
> +# XXX need to figure out a way not to have multiple pkg entries for old ones.
> +FORCE_PKG_REGISTER=    # defined

I don't want to appear smug, but the old way that we had of not registering
pkg_install and similar packages seems to be a better solution than the
following:
 
> This is messy because I end up with:
> 
> drwxr-xr-x  2 root root 4096 Apr  8  2004 /var/db/pkg/pkg_install-20040330
> drwxr-xr-x  2 root root 4096 Apr  9  2004 /var/db/pkg/pkg_install-20040409
> drwxr-xr-x  2 root root 4096 May 26  2004 /var/db/pkg/pkg_install-20040508
> drwxr-xr-x  2 root root 4096 Jul 22  2004 /var/db/pkg/pkg_install-20040508nb1
> drwxr-xr-x  2 root root 4096 Jul 22  2004 /var/db/pkg/pkg_install-20040508nb2
> drwxr-xr-x  2 root root 4096 Jan  7 10:02 /var/db/pkg/pkg_install-20050106

OK, only joking - the non-registration method had distinct problems for
binary package users.

However, the above is indeed pretty messy.

> It would be good if it could set PKG_TOOLS_BIN to the appropriate WRKSRC
> directory or set PKG_ADMIN and PKG_CREATE to work version at the
> right time.

It strikes me that, once we're sure that the new pkg_install is in place
and working fine, the old ${PKG_DBDIR}/pkg_install-<oldversion> directory
should be removed, along with all its contents.

I'll try to think of a way to do this cleanly.

Regards,
Alistair