Subject: Re: Package update disaster
To: Steven M. Bellovin <>
From: Karsten Kruse <>
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 -D > delete_order
>>>    pkgdepgraph -R >
>>>    pkgdepgraph -F >
>>>    sh && mv
>>>    pkg_delete `cat delete_order` && mv delete_order delete_order~
>>>    sh
>>>    /bin/rm -f delete_order~

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

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

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


         Homepage, Mac68k, A/UX-Links und Shorties:
   ()    Linux/NetBSD-Anleitungen, Forum  und Chat:
  _/\_   If it works and its stupid, then it is not stupid.