Subject: Re: Introducing a better way of updating packages (long)
To: Julio Merino <>
From: Frederick Bruckman <>
List: tech-pkg
Date: 05/17/2002 05:46:21
On Fri, 17 May 2002, Julio Merino wrote:

> On Thu, May 16, 2002 at 08:45:00PM -0500, Frederick Bruckman wrote:
> >
> I like the idea, though I have a comment. Currently, to upgrade a package
> (lets say a library) I do:
> pkg_delete -f mylib
> cd /usr/pkgsrc/devel/mylib
> make && make install

So essentially, with "pkg_hack" you would just do

  make install

which does "make && pkg_hack -d mylib && make install". Or, if it's
one of those broken packages that won't build while it's old headers
are installed, you could do

  make deinstall
  make install

as the first invokes "pkg_hack -d mylib".

> This works almost always, as packages can work with a slightly new version
> of the library. I think that -so-* packages should only be done if some
> package requires that version *explicitly*. That is, we usually tell pkgsrc
> dependencies with something like: mylib>=3.24, that is, equal or over 3.24.
> So if we update the library to 3.25, there should be no need to keep 3.24
> if packages depend on 3.24 or over.

The problem with that is that the dependencies in pkgsrc are often
wrong. Plus, it doesn't hurt anything to keep the old shared library
minor versions around for a while, especially as they remain
registered. If the new package (or old -- you can go backwards just as
easily) has exactly the same *files* as the formerly fully installed
package, the former package disappears without a trace -- there's no
need to rely on the dependencies.

> This can be accomplished with freebsd's portupgrade technique... and this is
> the only problem I'm having now. As deinstalling a package, forcing it, you
> loose dependency information. When updating a package of this kind, the old
> dependency list should be kept and "copied" in the new package information,
> under /var.

I don't know anything about freebsd's portupgrade technique. Tell us
about it. What does it have over on "pkg_hack"?

"pkg_hack" does preserve the dependents, and it changes the
dependencies in all the dependents, too. The advantage, particularly,
over force upgrading is that, for example

  pkg_info -L '*-SO-*'

gives you a survey of all the leftovers, and

  pkg_info -q -R '*-SO-*'

generates a list of all the packages remaining to be upgraded, while

  pkg_delete '*-SO-*'

"cleans house", deleting only the packages that no longer have
dependents. (To do that last automatically is on the TODO list.)

> Although I like it, and I hope this to be available "soon" ;)

It's available now, such as it is. We've never actually supported
having multiple versions of packages installed in any form, so there
are a lot of subtle issues in pkgsrc itself that have to be resolved
before this could ever be the default.