[Moving this thread to install-discuss.

Background: pkg upgrade by pkgrm + pkgadd is really obnoxious in that it
makes it difficult for the system and the user to distinguish between
"update this pkg, retain customizations" and "remove this pkg, remove
customizations, re-install the pkg."  SMF is one of those facilities
where there's plenty of room for customizations that must be preserved
on upgrade, thus the interest in pkg update functionality.]

On Wed, Feb 07, 2007 at 06:26:04PM -0800, David Powell wrote:
> > I happen to be fond of our pkg system and I've written many an
> > updateable package (where you update by pkgadd w/o a prior pkgrm).
> > 
> > SUNW packages, however, aren't -- you have to pkgrm + pkgadd.
> 
>   While some packages have, on their request, their old version removed
>   as part of the upgrade process, in general that isn't true.  We
>   certainly require packages in ON to be upgradeable [1].

> [...]
>   I think most packages that need to know that they're being upgraded
>   aren't going to work right if you remove them first.  Usually the
>   bits that need special treatment on upgrade are the administrator-
>   editable parts you need to keep around.

Huh, well I'll be...  I did think that this might be the case, that any
pkg that can be upgraded by pkgrm + pkgadd should also be upgradeable
via instance=overwrite, but I wasn't sure.

One nice thing when doing pkg updates is that pkgadd sets an environment
variable to indicate this to the pkg scripts.

>   In addition to not providing an easily accessible interface for
>   upgrading packages, the biggest functional gap (and perhaps this is
>   what your packages try to work around) is the packaging tools
>   themselves don't track which files need to be removed when
>   overwriting an existing package.  Solaris upgrade relies on an
>   external mechanism to strip the system of unnecessary files.

Yes, but this too is something that pkgadd could just learn to do.

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)

 - 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)

Nico
-- 

Reply via email to