From owner-freebsd-hackers Wed Sep 29 16: 5:21 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cx344940-a.meta1.la.home.com (cx344940-a.meta1.la.home.com [24.6.21.74]) by hub.freebsd.org (Postfix) with ESMTP id 9284914E0C for ; Wed, 29 Sep 1999 16:05:09 -0700 (PDT) (envelope-from conrads@cx344940-a.meta1.la.home.com) Received: (from conrads@localhost) by cx344940-a.meta1.la.home.com (8.9.3/8.9.2) id SAA40614; Wed, 29 Sep 1999 18:04:57 -0500 (CDT) (envelope-from conrads) Message-ID: X-Mailer: XFMail 1.3.2pre1 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 29 Sep 1999 18:04:56 -0500 (CDT) Organization: @Home Network From: Conrad Sabatier To: Christian Carstensen Subject: RE: updating packages automatically, etc.pp. Cc: mns@metathink.com, freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 28-Sep-99 Christian Carstensen wrote: > > so far, so good, > > first of all, thanks for giving me this much input on my idea. > i've had a look at the pkg_version tool, which, with Nik Clayton's > patch, does more or less what i've been thinking of, when i decided > to post the initial message to this list. as Mark Shepard > discussed in detail, there are a lot of useful features, > pkg_version is still lacking. (mark, special thanks to you for > taking down these useful notes!) i'm interested in implementing > at least some of this functionality using perl, if enough of you > regard this as a useful tool for system admin. otherwise, i'll > put it on the stack of things to do, when nothing else has to > done ;) how do you think about it? Here's a simple little Bourne shell script I threw together the other day to automatically upgrade installed ports. I've already used it myself, and it works just as expected. The script relies on you having an up-to-date INDEX file; do "make index" first to be sure (which reminds me, why is the INDEX file always out of sync after a cvsup?). It only tries to upgrade ports which have a single version installed, basically because I haven't gotten around yet to handling the parsing of pkg_version's output where more than one version of a port is installed. :-) The script checks to make sure that the new version builds successfully and is ready to be installed before deleting the old version (the reason for all those "&&" thingies). It should probably also check to see whether a port is interactive or not, but that's another thing I have yet to do. :-) Ignore the line wrap, by the way: #!/bin/sh for old_pkg in `pkg_version -v | grep '<' | awk '{print $1}'` do new_pkg=`echo $old_pkg | sed 's/-[0-9].*$//'` echo Upgrading $old_pkg cd /usr/ports/*/${new_pkg} && make && pkg_delete -f $old_pkg && make install clean done -- Conrad Sabatier http://members.home.net/conrads/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message