On Thu, Feb 08, 2007 at 11:25:15AM -0800, David Powell wrote: > > Basically I think we're talking about a handful of improvements to > > pkgadd: > > > > - a command-line option to force upgrade/overwrite of a given instance > > (for pkgs w/o MAXINST=1) > > Side note: Though instances are a weird construct whose purpose I > never quite understood, my impression is that making any connection > between MAXINST=1 and upgrading/upgradability is semantically wrong.
I too agree wholeheartedly. I've never quite understood pkg instances, and I have a very hard time believing that there are many packages that actually handle that properly. For one they have to be relocatable, which means not only that the prototype and pkginfo files have to be setup properly, but that the programs/scripts installed that make references to other parts of the pkg have to be aware of relocation, or at the very least linked with -R \$ORIGIN/../lib and the scripts have to do equivalent things. > I think having an option which set instance=overwrite without > needing to specify an admin file would be nice. Right, that's what I'm asking for, plus a way to name the instance being overwritten (for any cases where people really do use pkg instances), with the default being "the first instance." > > - a command-line option, possibly the same as above, to force removal > > of files that are not in the new version of the pkg (IIRC patching > > uses sparse package updates, where this would be bad as a default) > > In most cases, though, that's what I want when I upgrade a package. > I'd argue this behavior should be the default when using your 'pkgadd > -u'. Yes. > Implementing this correctly is a little tricky, though. The thing > which makes it difficult is that files which move between packages > should be left alone. You would need to support taking a set of > packages you want to upgrade, and compute the set of files to be > removed based on the old and new contents of entire set. (Okay, not > that tricky.) This is what pkg dependencies are for -- extend that to add versions and to tell pkgadd that these have to be upgraded together. > Doing this with the existing tools (and a little help from everyone's > not-quite-public friend, /var/sadm/install/contents) is certainly > possible. Unfortunately, I think the ease of doing so has resulted > in the functionality not being sedimented into the packaging tools > where it belongs. But what tools do this? BTW, another potential benefit of pkg update is that unchanged files are left, well, unchanged. Nico --