tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg_add and update

On Fri, Feb 25, 2011 at 11:08:58AM +0100, Thomas Klausner wrote:
> My preferred solution would be that pkg_add be improved so that it can
> automatically update all or at least a complex subset of all installed
> packages, handling this case automatically, and not every tool that
> sits on top of it must learn another way to cope with this kind of
> problem.

Just to give you a heads-up, that's how we handle updates in OpenBSD.
We have a concept of UpdateSet: when you run an update, pkg_add does a
back-and-forth to put together a set of packages that absolutely must be
updated together.

Goes on like this:
- use conflict handling to merge together stuff that must be updated together.
- looks at dependencies and merge updatesets when a dependency requires some
specific version (e.g., mysql-server and mysql-client must be updated together)
- handle shared libs specifically, by keeping old libs until all updates have
been done.

There are a few surprises you need to deal with:
- when merging updatesets because of dependencies, sometimes there are
other packages in the dependency chain, and you may need to merge more to
avoid dependency loops
- updatesets actually contain 3 parts: old packages to replace, new packages
to install instead, and packages that don't change, but participate to conflict

I won't go into further details, since your tools and data are significantly
different, but in order to do clean updates, all those issues must be dealt
with... yes, it's complicated.

Home | Main Index | Thread Index | Old Index