Subject: Re: Package update disaster
To: Steven M. Bellovin <smb@research.att.com>
From: Karsten Kruse <tecneeq@tecneeq.de>
List: netbsd-users
Date: 10/08/2004 19:38:27
On Thu, 7 Oct 2004, Steven M. Bellovin wrote:
>>>> Is there a perhaps simpler way to tell pkgsrc:
>>>> "bring-EVERYTHING-up-to-date-and-don't-ask-for-further-input" ?
There is pkg_chk, but if you don't have a pkgchk.conf it is hard to
recover from errors.
>>> set -e
>>> cd /usr/pkgsrc
>>> cvs -dAP
>>> lintpkgsrc -omr
>>> lintpkgsrc -i > pkgdepgraph.in
>>> pkgdepgraph -D pkgdepgraph.in > delete_order
>>> pkgdepgraph -R pkgdepgraph.in > rebuild.sh
>>> pkgdepgraph -F pkgdepgraph.in > fetch.sh
>>> sh fetch.sh && mv fetch.sh fetch.sh~
>>> pkg_delete `cat delete_order` && mv delete_order delete_order~
>>> sh rebuild.sh
>>> /bin/rm -f pkgdepgraph.in delete_order~ rebuild.sh fetch.sh~
>> On a this-is-simple scale ranging from "1" to "10", this is a "12" :-(
> Well, I did describe it as "a bit complex"...
I wrote a script that should make it simpler:
http://tecneeq.dyndns.org/~karsten/scripte/smartupdate
>> Hm ... maybe we should think about a mechanism for this, maybe also
>> for a binary package updater? Just a though.
> I agree. What I like best about this scheme is that it's reasonably
> robust, and lets you recover from compilation failures -- you have a
> record of the state before wiping out everything.
The script uses pkg_tarup to backup packages before doing anything else.
You have the chance to go back to your previous state by installing the
backup-packages.
> I agree that we should package it up. It does need some improvement;
> it doesn't deal properly with packages that have been renamed, and
> hence generate errors from lintpkgsrc.
Agreed. However, that does not solve the one big design-flaw in pkgsrc:
to build a package you need it's dependencies installed. Maybe it's
possible with pkgviews somehow? Install the new stuff and delete the
older packages only if everything worked?
Karsten
--
Homepage, Mac68k, A/UX-Links und Shorties: www.tecneeq.de
() Linux/NetBSD-Anleitungen, Forum und Chat: www.newbie-net.de
<\/>
_/\_ If it works and its stupid, then it is not stupid.