Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2007 01:18:02 -0500
From:      Mike Meyer <mwm-keyword-freebsdhackers2.e313df@mired.org>
To:        Joan Picanyol i Puig <lists-freebsd-hackers@biaix.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: pkg_upgrade (was Re: pkg_add does not backtrack, does it?)
Message-ID:  <17865.28442.623829.375834@bhuda.mired.org>
In-Reply-To: <20070207020205.GC62321@grummit.biaix.org>
References:  <8b4c81f0702061514r5a753e48yea0ce9b937236fc3@mail.gmail.com> <17865.6041.605201.772296@bhuda.mired.org> <20070207020205.GC62321@grummit.biaix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In <20070207020205.GC62321@grummit.biaix.org>, Joan Picanyol i Puig <lists-freebsd-hackers@biaix.org> typed:
> * Mike Meyer <mwm-keyword-freebsdhackers2.e313df@mired.org> [20070207 01:05]:
> > If you let us know what your goals are, we might be able to help you
> > get there.
> 
> I know what I'd like: a utility in the base system for binary upgrading
> of packages. More flexible logic in how the '-r' option is handled would
> be nice (being able to fetch all packages from All/ even if you are
> on RELENG). Doesn't
> 
> freebsd-update fetch install && pkg_upgrade -a
> 
> look nice for keeping up to date?

Not particularly, but why does it have to be in the base system?
freebsd-update isn't. But if you insure the ports database is pristine
and want to blindly update all your installed packages at once, you
can do something like:

freebsd-udpate fetch install && (portversion -c -C P | /bin/sh)

I haven't tested it; in particular I'm not sure I got the syntax for
-C right, and there are probably other things that are broken as well.

> The obvious hairy details must be
> harder than it seems, I'm sure others have considered it (and would have
> done it) before.

The thing is, chances are pretty good that at some point or another,
you're *not* going to want to just update all the installed
packages. Some package may require external work, or you may want to
follow a different branch than the main port, or an update may include
a new bug that you can't live with, or you may have something
installed that's not in the ports tree that breaks if you update a
port, etc.

And of course, this doesn't work well if you've managed to corrupt the
ports database, which is all to easy to do. Or at least I've found
that to be the case. Maybe if I could only convince myself to *always*
use portinstall, and not just do a "make install" after I've read
through the package description, things wouldn't be so bad, but they
are.

People have tried this. portupgrade is the most complete solution I
know of, though there are others in the ports tree. It can do
binary-only upgrades, or can be set to try the binaries first, and
only build if the binaries aren't available. It also has flags to save
the old install, and a config file that lets you hold packages, or set
build options if you build.

	<mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17865.28442.623829.375834>