From owner-freebsd-questions@FreeBSD.ORG Mon Jun 29 20:58:26 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509571065674 for ; Mon, 29 Jun 2009 20:58:26 +0000 (UTC) (envelope-from meslists@yahoo.fr) Received: from smtp134.mail.ukl.yahoo.com (smtp134.mail.ukl.yahoo.com [77.238.184.65]) by mx1.freebsd.org (Postfix) with SMTP id B9CFD8FC1E for ; Mon, 29 Jun 2009 20:58:25 +0000 (UTC) (envelope-from meslists@yahoo.fr) Received: (qmail 5969 invoked from network); 29 Jun 2009 20:58:24 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:Reply-To:To:Subject:Date:User-Agent:References:In-Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=kcpIowEvULRSAZ9wbxBplLXLmtiBgN4vnhffftt7lYy/cH/zCXXfjRfW2DVFPMvWETK4ZFH41xfwjkLZOJpfIXjaLy8NVOT1YE5gdq2elwbWHuQJfF2U15tAbtf/gF1OuSBilzb8TXzghlxsxK/+BYPBaw8jsW+HiSuW7/19gbY= ; Received: from unknown (HELO suer) (meslists@151.49.232.192 with plain) by smtp134.mail.ukl.yahoo.com with SMTP; 29 Jun 2009 20:58:24 -0000 X-Yahoo-SMTP: vQQ_Xl6swBCl_II246m4P1b5oVD4 X-YMail-OSG: ArXlT28VM1k9yQpCATZ_zWOMKjQf2I7cOZjH_7TBe3gXuobderBhTm8v.4DDMpVX4ciu4C_FkKrS8_V2VTHJbO1UvLVb_Vgpks15wykQVv21IFMRY7_K9EZGLIS4.2HHKv1mYB3LaTaW827VBqCfMVIh8gqhSH_pnxzxhu9PUpxWiQ1vBtGSYZi2uvPwCIFU_RSvua9_mmEtMIUlSOAQ.Kub2DKzj81m_wBtK8Ngc3mXcqOJaygdVp4IECAKL._ZTigfGvKUUUENKVH_ijMBG51plsh4XzCNONgwNJeV2STWHGQC9eQ- X-Yahoo-Newman-Property: ymail-3 From: dan To: mfv Date: Mon, 29 Jun 2009 22:57:39 +0200 User-Agent: KMail/1.9.10 References: <200906212038.39370.meslists@yahoo.fr> <20090622214802.0761813e@gumby.homeunix.com> <200906241119.09827.mrkvrg@acm.org> In-Reply-To: <200906241119.09827.mrkvrg@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906292257.39730.meslists@yahoo.fr> Cc: freebsd-questions@freebsd.org Subject: Re: upgrading installed ports: time to do it ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: meslists@yahoo.fr List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2009 20:58:26 -0000 On Wednesday 24 June 2009 17:19:09 you wrote: > On Monday, 22 June 2009 16:48:02 RW wrote: > > On Mon, 22 Jun 2009 20:58:41 +0100 > > > > Chris Whitehouse wrote: > > > I'll probably get flamed for this but since I've been using > > > ports-mgmt/portmanager I've almost forgotten > > > about /usr/ports/UPDATING and all that pkgdb -Fu stuff or whatever it > > > was. I've upgraded ports just by doing 'portmanager -u' over one or > > > two quite major changes and not had any problems that haven't been > > > down to an individual ports. > > > > You still need to read UPDATING, portmanager handles some of the > > issues automatically, but not all. > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to > > "freebsd-questions-unsubscribe@freebsd.org" > > Hello, > > Here is a perl hack I use to automatically read and parse UPDATING as part > of my daily upgrade routine. It is part of a larger set of five scripts > which use: > 1. "csup" to update ports > 2. "make index" to update the /usr/ports/INDEX > 3. "pkg_version" to identify the ports that need upgrading > 4. "portfetch" to download the tarballs > 5. a script to display the relevant contents, if any, of UPDATING using > the hack shown below and the contents identified in step 3 above. > > These five scripts are combined in a master script (csup-all) which I > invoke the first thing in the morning. After doing some other morning > chores I then run "portconfig -a -v" to set up any configuration settings > prior to running "portmaster -a -u". Everything is automatic except for > the configuration. > > Here is the perl hack. It can be improved by comparing the ports that need > to be updated (step 3) with the ports specified within UPDATING (step 5). > The embedded ansi codes will work with the default FreeBSD console > settings, otherwise they can be removed. > > #!/usr/bin/perl > # > # file: csup-update.pl > # > # created: 2006-07-16 > # > # purpose: To review update notes in /usr/ports/UPDATING > # This program will only display those notes issued > # since last csup > # > # algorithm: Each line of the file /usr/ports/UPDATING is scanned and if > # it finds a date in the form ^yyyymmdd$ the date is assigned > # to the variable $date. Otherwise all non-date lines are printed > # to STDOUT. As soon as this program finds a date older than the > # last update this program quits and prints an appropriate closing > # message. > # > unless ( open ( MYFILE, "/usr/ports/UPDATING" ) ) { > die ("Cannot open input file /usr/ports/UPDATING.\n") ; > } > > unless ( open ( LASTUPDATE, "/root/bin/csup-lastupdate.txt" ) ) { > die ("Cannot open file csup-lastupdate.txt.\n") ; > } > > $eof = '' ; > $date = $lastupdate = ; > $line = ; > $count = 0 ; > > while ( $line ne $eof ) { > if ( $line =~ /^2\d{7}/ ) { > $date = $line ; > $date =~ tr/://d ; > $count++ ; > } > > if ( ( $date - $lastupdate ) >= 0 ) { > if ( $line =~ /^2\d{7}/ ) { > print ("^[[32m$line^[[0m") ; > } else { > print ("^[[0m$line") ; > } > $line = ; > $date = $lastupdate ; > } else { > $count-- ; > if ( $count == 0 ) { > print ( "^[[36mThere are no updates to review. ") ; > } elsif ( $count == 1 ) { > print ( "^[[36mThere is only one update to review. ") ; > } else { > print ( "^[[36mThere are $count updates to review. ") ; > } > chop ( $lastupdate ) ; > print ( "The last run of csup was on $lastupdate.^[[0m\n\n" ) ; > > exit ; > } > } > # EoF > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" Hello mfv ! Thanks for sharing your perl hack and your experience :-) I do not know anything about PERL, but I am starting taking a look at this ! THanks dan