From owner-freebsd-questions@FreeBSD.ORG Wed Oct 3 12:25:50 2007 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 35EBF16A418 for ; Wed, 3 Oct 2007 12:25:50 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 18F0313C43E for ; Wed, 3 Oct 2007 12:25:49 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id A80AA1CDEE for ; Wed, 3 Oct 2007 04:25:48 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org Date: Wed, 3 Oct 2007 14:25:18 +0200 User-Agent: KMail/1.9.7 References: <200710021923.29750.daniel.tourde@spray.se> <20071002215320.13360851@gumby.homeunix.com.> In-Reply-To: <20071002215320.13360851@gumby.homeunix.com.> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710031425.20972.fbsd.questions@rachie.is-a-geek.net> Subject: Re: How to check applications vs. libraries X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Oct 2007 12:25:50 -0000 On Tuesday 02 October 2007 22:53:20 RW wrote: > On Tue, 2 Oct 2007 19:23:29 +0200 > > Daniel Tourde wrote: > > I am used to install FreeBSD applications by using the port > > collection. I also update regularly (twice a month or something) the > > apps, using 'portupgrade -a -N' on a refreshed port collection. > > > > Here are my questions: > > - How can I check that the apps that have been build with certain > > libraries still work when some of the libs have been updated? > > - Is it possible then to rebuild the selected set of apps that have > > been 'corrupted' by the library upgrade (classicaly from liba.1 to > > liba.2)? If yes, how? > > Generally this doesn't cause a problem as when portupgrade upgrades a > library through a major revision, it puts a copy of the old library > into a compatibility directory. True. /usr/local/lib/compat/pkg > Applications that depend on updated libraries get version-bumped when > the library major version gets changed Not true. Only direct dependants get version bumped and not consistently either. To recompile all dependants against the latest version of a library, one has to find out which port the older version in /usr/local/lib/compat/pkg belongs to and forcibly upgrade all deps of that package, using `portupgrade -fr'. I use the following little php script to identify programs/libraries still using old libs: #!/usr/local/bin/php -q /dev/null| grep compat/pkg'; $search_paths = array('bin', 'sbin', 'lib', 'libexec'); chdir($localbase); foreach($search_paths AS $path) { echo("==> $path\n"); $files = glob("$path/*"); foreach($files AS $file) { $check = shell_exec(sprintf($cmd_fmt, $file)); if( empty($check) ) continue; // pretty print reformat $check = preg_replace('/^.*?=>/m', "\t\t=>", $check); echo("\t$file depends on:\n$check"); } } ?> Given time, I could probably come up with something fully automated, but in practice, it boils down to 2 or 3 libraries, usually of the sort gettext, expat, vorbis, xml/xslt. It's not full-proof, because some paths aren't searched, for example /usr/local/openoffice, just adjust the search_paths array if you need to. -- Mel