From owner-freebsd-ports@FreeBSD.ORG Fri May 18 21:47:32 2007 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03AC216A400 for ; Fri, 18 May 2007 21:47:32 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-3-125.belrs4.nsw.optusnet.com.au [220.239.3.125]) by mx1.freebsd.org (Postfix) with ESMTP id 8188913C44B for ; Fri, 18 May 2007 21:47:31 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.14.1/8.14.1) with ESMTP id l4ILlULV029660 for ; Sat, 19 May 2007 07:47:30 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.14.1/8.14.1/Submit) id l4ILlU3s029659 for ports@freebsd.org; Sat, 19 May 2007 07:47:30 +1000 (EST) (envelope-from peter) Date: Sat, 19 May 2007 07:47:30 +1000 From: Peter Jeremy To: ports@freebsd.org Message-ID: <20070518214729.GA29623@turion.vk2pj.dyndns.org> References: <20070507201448.GA52651@xor.obsecurity.org> <20070507204414.GA53358@xor.obsecurity.org> <20070507205850.GA34916@lor.one-eyed-alien.net> <20070507220659.GC78665@graf.pompo.net> <20070507222146.GA57768@xor.obsecurity.org> <464CB5AA.7040304@FreeBSD.org> <1179437517.8912.5.camel@ikaros.oook.cz> <20070518075058.GB1164@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <20070518075058.GB1164@turion.vk2pj.dyndns.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Subject: Re: Specs for saving old shared libs 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: Fri, 18 May 2007 21:47:32 -0000 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-May-18 17:50:58 +1000, Peter Jeremy = wrote: >Ideally, you also need some way to identify (and remove) old .so files >that are no longer referenced by anything. This is not as easy >because there's no record of what ports use what .so's (and no way to >track apps outside the ports system). OK, my offering to assist with this scans a specified set of file trees and reports any executables that reference shared libraries in compat or that can't be found: #!/bin/sh # # Find executables using compat libraries find -x "$@" -type f -perm +0100 -print0 |\ ( xargs -0 ldd 2>&1 >&3 | \ egrep -v "not a dynamic executable|can't read program header|Exec format e= rror" >&2 ) 3>&1 |\ awk '/^[^ ]/ { exe =3D $0; next } NF !=3D 4 || $3 ~ /\/compat\// || $4 !~ /^\(0x[0-9a-f]*[1-9a-f]/ {= print exe, $0}' --=20 Peter Jeremy --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGTh7x/opHv/APuIcRAt0LAKDAO+uXP3pV8NdN5qAzduoXeKSErwCeOAic fdNnSuEQ5JC0dxTmxH2hT3I= =fPzl -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62--