From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 29 01:01:22 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C88B16A4DE for ; Tue, 29 Aug 2006 01:01:22 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (vpn.mired.org [66.92.153.74]) by mx1.FreeBSD.org (Postfix) with SMTP id BB29043D45 for ; Tue, 29 Aug 2006 01:01:21 +0000 (GMT) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 25592 invoked by uid 1001); 29 Aug 2006 01:01:13 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Mon, 28 Aug 2006 21:01:13 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17651.37337.346614.609322@bhuda.mired.org> Date: Mon, 28 Aug 2006 21:01:13 -0400 To: hackers@freebsd.org X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: Mike Meyer X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) Cc: Subject: Speaking of trivial tools X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Aug 2006 01:01:22 -0000 I realized today that this one was possible. I suspect it would be useful to lots of people working on ports, as well as for the sysadmin stuff I do with it. I'm just not sure where it should goes. -------------------- checkdeps.sh #!/bin/sh TMPFILE=/tmp/checkdeps.$$ pkg_info -r $1 | sed -n 's/Dependency: //p' | sort -u > $TMPFILE ldd $(pkg_info -L $1) 2>/dev/null | \ sed -e '/^\//d' -e 's/.*=> //' -e 's/(.*)//' | \ sort -u | \ xargs -n 1 pkg_info -W | \ sed 's/.* //' | \ grep -v $1 | \ sort -u | \ comm -23 - $TMPFILE rm $TMPFILE -------------------- Hand it a package name as an argument, and it'll print out the names of any packages providing libraries used by binaries in the package given as an argument that aren't listed as a dependency for that package. I fed it my complete list of packages, and it turned up some interesting things - like a package that had a dependency on a newer version of itself(!). This is just a QAD hack. It certainly got a lot of rough edges yet. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.