Subject: Re: pkg/30347
To: None <pkg-manager@netbsd.org, jlam@netbsd.org, pkgsrc-bugs@netbsd.org,>
From: None <jlam@netbsd.org>
List: pkgsrc-bugs
Date: 09/19/2005 06:11:32
Synopsis: +DEINSTALL scripts are incomplete

Responsible-Changed-From-To: jlam->pkg-manager
Responsible-Changed-By: jlam@netbsd.org
Responsible-Changed-When: Mon, 19 Sep 2005 06:11:30 +0000
Responsible-Changed-Why:
This is not properly just my responsibility.


State-Changed-From-To: open->analyzed
State-Changed-By: jlam@netbsd.org
State-Changed-When: Mon, 19 Sep 2005 06:11:30 +0000
State-Changed-Why:
The underlying problem is how to require a certain version of the pkg_*
tools to install a given binary package.  This can be solved in a number
of different, two of which I list here:

  (1) Modify the pkg_create tool to add a @pkgtools-version field to
      the +CONTENTS file during package creation that notes the version
      of the pkg_* tools used to create the binary package.  The
      pkg_add tool can then be modified to check this field to see if
      the version of pkg_add is at least as big as the one in 
      @pkgtools-version.  This fix requires no change to the packages
      themselves.

  (2) Modify every package that sets USE_PKGINSTALL (and thus probably
      unpacks +* helper scripts) to add PRE-INSTALL action to the
      +INSTALL scripts that ensures the version of pkg_add being used 
      to add the package is bigger than the one recorded in the +INSTALL
      script, where the recorded version is the version of pkg_create
      used to create the binary package.  This fix requires a PKGREVISION
      bump for all packages that set USE_PKGINSTALL.

Option 1 is definitely nicer because the fix is transparent; however 
it requires modifying the pkg_install sources.  Option 2 is uglier
because of the PKGREVISION bumps, but is extremely easy to implement 
within the existing bsd.pkginstall.mk framework.  I'm in favor of 
option 2 because I wrote the bsd.pkginstall.mk framework and it's
obvious to me how to solve it that way.  I'll let others debate the
way they would prefer to solve this problem.