From owner-freebsd-ports@FreeBSD.ORG Mon Aug 3 12:31:44 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 D54401065670 for ; Mon, 3 Aug 2009 12:31:44 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9828FC15 for ; Mon, 3 Aug 2009 12:31:43 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from significant-gravitas-shortfall.thebunker.net (gateway.ash.thebunker.net [213.129.64.4]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id n73CVT2l073939 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Aug 2009 13:31:35 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk n73CVT2l073939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1249302696; bh=PxEMrX4JlrCU86R7O/Q7PqKjn4ysfWI8xLFxqLS+N1U=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4A76D89B.60803@infracaninophile.co.uk>|Date:=20Mon ,=2003=20Aug=202009=2013:31:23=20+0100|From:=20Matthew=20Seaman=20 |Organization:=20Infracaninophile |User-Agent:=20Thunderbird=202.0.0.22=20(X11/20090727)|MIME-Versio n:=201.0|To:=20Garrett=20Cooper=20|CC:=20Peter =20Jeremy=20,=20=0D=0A=20freebsd-por ts@freebsd.org|Subject:=20Re:=20ports/*/jpeg=20"Thanks=20a=20lot=2 0guys"|References:=20<20090731121249.538ea7e7.jasonh@DataIX.net>=0 9=20<20090731173636.GA76357@owl.midgard.homeip.net>=09=20<4A740679 .1020608@infracaninophile.co.uk>=09=20=09=20<4A747C77.1040800@infracaninophile.co.uk>=09=20<200908 01224323.GA65040@server.vk2pj.dyndns.org>=09=20<4A7552C8.7020508@i nfracaninophile.co.uk>=09=20<4A75A813.10307@infracaninophile.co.uk >=20<7d6fde3d0908030148h3b5a5934lb0ade13d8b095105@mail.gmail.com>| In-Reply-To:=20<7d6fde3d0908030148h3b5a5934lb0ade13d8b095105@mail. gmail.com>|X-Enigmail-Version:=200.95.7|OpenPGP:=20id=3D60AE908C|C ontent-Type:=20multipart/signed=3B=20micalg=3Dpgp-sha1=3B=0D=0A=20 protocol=3D"application/pgp-signature"=3B=0D=0A=20boundary=3D"---- --------enig3E3F2852498F474AE3B036F5"; b=WYmlkClZ600fWPxwZwW0toN5dDkhcnZE7WHN2SQgI5xVJRmbxVqFzJLrod38UrgOW L/JaO9QHExVqJ0/GdjntE0NIr0YjyY9Nyd0008GSrkYhUEZLjAhUOC+j3zWfrjV1bB Pfg25C4XqGRjt2WLf5ZdAarB4N9WJzy0UHjK2cG4= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host gateway.ash.thebunker.net [213.129.64.4] claimed to be significant-gravitas-shortfall.thebunker.net Message-ID: <4A76D89B.60803@infracaninophile.co.uk> Date: Mon, 03 Aug 2009 13:31:23 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.22 (X11/20090727) MIME-Version: 1.0 To: Garrett Cooper 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> <7d6fde3d0908030148h3b5a5934lb0ade13d8b095105@mail.gmail.com> In-Reply-To: <7d6fde3d0908030148h3b5a5934lb0ade13d8b095105@mail.gmail.com> X-Enigmail-Version: 0.95.7 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3E3F2852498F474AE3B036F5" X-Virus-Scanned: clamav-milter 0.95.2 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,SPF_FAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk 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 12:31:45 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3E3F2852498F474AE3B036F5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Garrett Cooper wrote: > 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. Whe= n >>>> jpeg is bumped, gd needs to be bumped because it LIB_DEPENDS on jpeg= =2E >>>> p5-GD then needs to be bumped because it LIB_DEPENDS on gd. rt38 do= es >>>> not need to be bumped because it has no LIB_DEPENDS on p5-GD. p5-RT= -* >>>> does not need to be bumped because rt38 is not bumped. >>>> >>>> This is slighly more complex than >>>> cd /usr/ports && \ >>>> for i in */*; do [ -d "$i" ] && cd "$i" && make all-depends-list ; = done >>>> | \ >>>> grep jpeg >>>> because you need to actually follow the dependency tree, but is not >>>> impractical. The only issues I can see with this approach are: >>>> 1) Mapping the shared library reported by 'make lib-depends' back to= the >>>> port than installs it. >>>> 2) You are relying on LIB_DEPENDS being correct: In my general exam= ple >>>> above, if A is missing a LIB_DEPENDS on C, this may not be detecte= d >>>> in the build process because of the implicit dependency on C via B= =2E >>>> >>>> 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. It's ab= out >>> 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 p= ort >>> 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, upd= ate >> 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 ju= st >> now: >> >> http://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. There's one = row of >> the file for each port, and each row contains 3 fields separated by '|= ' >> characters: >> >> package-name|port/origin|space separated list of lib_depends port ori= gins >> >> So, to extract the list of ports depending on www/jpeg: >> >> happy-idiot-talk:/tmp:% grep graphics/jpeg SHLIBS | cut -d '|' -f 1-2 = | head >> -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. For 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 reg= ister >> 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_DEPE= NDS 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. >=20 > There actually may be a much easier solution to this problem. >=20 > 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 :)? >=20 > 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. If it's going to scan *all* of the installed files known to the pkg=20 database to identify packages that depend on a particular shared library then it's going to take a pretty long time to run on a typical desktop package load. It would make sense to scan the installed files at package installation time and cache the result for each installed package, which is pretty=20 much where I was at with the Bourne shell script I posted up-thread. There was a question about apps that use dlopen() to load libraries,=20 rather than letting ld.so do the work for them. I don't think that using ldd(1) will pick up any app that does that, but then again I=20 don't know if this is a widespread practice, and if it is, whether there is any simple way to pick out packages that need reinstallation because of it other than by using manually defined LIB_DEPENDS settings in port Makefiles. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. Flat 3 7 Priory Courtyard PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW, UK --------------enig3E3F2852498F474AE3B036F5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkp22KAACgkQ3jDkPpsZ+VZqvgCeK4hkuI5wyFAiwVi0ZGf0/gOh NBMAmwYpLl0XBtsCwzpgO/jPUFRBBXYb =eByu -----END PGP SIGNATURE----- --------------enig3E3F2852498F474AE3B036F5--