From owner-freebsd-ports@FreeBSD.ORG Mon Aug 3 09:11:14 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B127106564A for ; Mon, 3 Aug 2009 09:11:14 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-yw0-f190.google.com (mail-yw0-f190.google.com [209.85.211.190]) by mx1.freebsd.org (Postfix) with ESMTP id C3A4D8FC13 for ; Mon, 3 Aug 2009 09:11:13 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by ywh28 with SMTP id 28so4263450ywh.27 for ; Mon, 03 Aug 2009 02:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=KPOS6d2iY2b94QhjOITmIJnPWtoaD5uWDFLHFasLqSE=; b=tgGelvjSmmDLaLWoweL3JMYzSu2ffJno3l1STMkKfaINOkto+l3xC53lSGV4zARTKD x3AbGfbIUbZsAvNWvYpRW083DtiZsqHnMCWPys6V/zrzS6QiCurJr8jL9dlqaUfImsyv u77cwpia1Rej7+deuLVoK/I+YW/OIUXFn/PW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=XPfhnj2mTsrswOaEx3ROdF8i1v9AF+E8JlgHCBZefpO2J4JXQdY4yk8UQzYsqG1W6j Fxz27n8YRB/WbxvY7UYKEXjI76f/goILK3bwHItJrdSzjaS6UDV7BSwms1OfbaSQNILG 8vhEYNOzLb8OA2XXN5uFs5/CNhLxOVX4SYZmY= MIME-Version: 1.0 Received: by 10.150.152.16 with SMTP id z16mr10053266ybd.278.1249289282569; Mon, 03 Aug 2009 01:48:02 -0700 (PDT) In-Reply-To: <4A75A813.10307@infracaninophile.co.uk> References: <20090731121249.538ea7e7.jasonh@DataIX.net> <20090731173636.GA76357@owl.midgard.homeip.net> <4A740679.1020608@infracaninophile.co.uk> <4A747C77.1040800@infracaninophile.co.uk> <20090801224323.GA65040@server.vk2pj.dyndns.org> <4A7552C8.7020508@infracaninophile.co.uk> <4A75A813.10307@infracaninophile.co.uk> Date: Mon, 3 Aug 2009 01:48:02 -0700 Message-ID: <7d6fde3d0908030148h3b5a5934lb0ade13d8b095105@mail.gmail.com> From: Garrett Cooper To: Matthew Seaman Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Peter Jeremy , freebsd-ports@freebsd.org Subject: Re: ports/*/jpeg "Thanks a lot guys" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2009 09:11:14 -0000 On Sun, Aug 2, 2009 at 7:52 AM, Matthew Seaman wrote: > Matthew Seaman wrote: > >> Peter Jeremy wrote: >>> >>> In this specific case, p5-RT-* depends on www/rt38 depends on >>> graphics/p5-GD depends on graphics/gd depends on graphics/jpeg. =A0When >>> jpeg is bumped, gd needs to be bumped because it LIB_DEPENDS on jpeg. >>> p5-GD then needs to be bumped because it LIB_DEPENDS on gd. =A0rt38 doe= s >>> not need to be bumped because it has no LIB_DEPENDS on p5-GD. =A0p5-RT-= * >>> does not need to be bumped because rt38 is not bumped. >>> >>> This is slighly more complex than >>> =A0cd /usr/ports && \ >>> =A0for i in */*; do [ -d "$i" ] && cd "$i" && make all-depends-list ; d= one >>> | \ >>> =A0grep jpeg >>> because you need to actually follow the dependency tree, but is not >>> impractical. =A0The only issues I can see with this approach are: >>> 1) Mapping the shared library reported by 'make lib-depends' back to th= e >>> =A0 port than installs it. >>> 2) You are relying on LIB_DEPENDS being correct: =A0In my general examp= le >>> =A0 above, if A is missing a LIB_DEPENDS on C, this may not be detected >>> =A0 in the build process because of the implicit dependency on C via B. >>> >>> No sample script because I'm not sure of the correct approach to 1) off >>> the top of my head. > >> Doing (1) using my p5-FreeBSD-Portindex code is pretty easy. =A0It's abo= ut >> time I released an update anyhow -- I'll code up a little app that >> processes >> the LIB_DEPENDS linkages already stored in the cache and lists each port >> that has a LIB_DEPENDS, together with all the ports it depends on >> cumulatively. > > I've got this working now -- I still need to do some more testing, update > documentation and stuff before I release version 2.2 of > p5-FreeBSD-Portindex, > but as a taster, here's the result of generating this on my machine just > now: > > =A0http://www.infracaninophile.co.uk/SHLIBS.bz2 > > (Note that this includes the effect of a number of local settings in > /etc/make.conf) > > It's similar to the ports INDEX file, when decompressed. =A0There's one r= ow of > the file for each port, and each row contains 3 fields separated by '|' > characters: > > =A0package-name|port/origin|space separated list of lib_depends port orig= ins > > So, to extract the list of ports depending on www/jpeg: > > happy-idiot-talk:/tmp:% grep graphics/jpeg SHLIBS | cut -d '|' -f 1-2 | h= ead > -10 > accerciser-1.6.1_1|/usr/ports/accessibility/accerciser > at-poke-0.2.3_4|/usr/ports/accessibility/at-poke > at-spi-1.26.0_1|/usr/ports/accessibility/at-spi > dasher-4.10.1_1,2|/usr/ports/accessibility/dasher > gnome-mag-0.15.8|/usr/ports/accessibility/gnome-mag > gnopernicus-1.1.2_6|/usr/ports/accessibility/gnopernicus > gok-2.26.0_1,1|/usr/ports/accessibility/gok > kdeaccessibility-3.5.10_2|/usr/ports/accessibility/kdeaccessibility > kdeaccessibility-4.2.4_1|/usr/ports/accessibility/kdeaccessibility4 > mousetweaks-2.26.3_1|/usr/ports/accessibility/mousetweaks > > Again, this has a number of deficiencies. =A0For instance, programs that > embed a perl interpreter will link against libperl.so =3D> > /usr/local/lib/perl5/5.10.0/mach/CORE/libperl.so, but none of them regist= er > a LIB_DEPENDS on lang/perl5.10. [See for example net-mgmt/net-snmpd, > www/mod_perl2] > > Similarly, programs that declare 'USE_MYSQL=3DNN' will have a LIB_DEPENDS= on > libmysqlclient.so.X added to their dependency mix even if they contain > no compiled ELF binaries [See net-mgmt/cacti databases/phpmyadmin] > > However, I think that the deficiencies are not too intractable to fix, > and this approach shows some promise. There actually may be a much easier solution to this problem. Gentoo Linux (I know -- Gentoo + Linux -- we're FreeBSD... blah :P) has a script called `revdep-rebuild' which goes and runs ldd on all pieces of software that are installed in portage (ok, substitute ports here). What I'm driving at is that we can use pkg_info and/or the mtree generated files to determine what files are installed, find out which packages have been broken up an update, then rebuild the port and all dependencies (LIB_DEPENDS?). What say you to that :)? If no one cares about the language, I can whip up a really quick python script which solves this problem and we can migrate to a more longterm solution in bourne shell if desired. Thanks, -Garrett