Specs for saving old shared libs

Peter Jeremy peterjeremy at optushome.com.au
Fri May 18 14:47:32 PDT 2007


On 2007-May-18 17:50:58 +1000, Peter Jeremy <peter at turion.vk2pj.dyndns.org> 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 error" >&2 ) 3>&1 |\
    awk '/^[^ 	]/ { exe = $0; next }
         NF != 4 || $3 ~ /\/compat\// || $4 !~ /^\(0x[0-9a-f]*[1-9a-f]/ { print exe, $0}'

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20070518/b56fe2af/attachment.pgp


More information about the freebsd-ports mailing list