From owner-freebsd-questions Sat Feb 23 22:44:41 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mired.org (dsl-64-192-6-133.telocity.com [64.192.6.133]) by hub.freebsd.org (Postfix) with SMTP id 4FADB37B417 for ; Sat, 23 Feb 2002 22:44:39 -0800 (PST) Received: (qmail 16605 invoked by uid 100); 24 Feb 2002 06:44:36 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15480.35795.543145.356610@guru.mired.org> Date: Sun, 24 Feb 2002 00:44:35 -0600 To: "Joe & Fhe Barbish" Cc: questions@freebsd.org Subject: Re: How to list port dependencies In-Reply-To: <72832603@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid 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/0.46 (Python 2.2; freebsd-4.5-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joe & Fhe Barbish types: > I want to list the path to the makefiles for all the > dependencies of a selected port. > > Is there a command to do this? No, but it makes a cute shell scripting problem. First, make sure your /usr/ports/INDEX file is up to date by doing a "make INDEX" in that directory - or "portsdb" -uU if you're using portupgrade - then run the following shell script in the selected ports directory: for pkg in `(make pretty-print-build-depends-list; make pretty-print-run-depends-list) | sed -e 's/.*) "//' -e 's/".*//'` do awk -F\| "/^$pkg\|/ { print \$2 } " /usr/ports/INDEX done | sed 's/$/Makefile/' This version works in /bin/sh. My first version didn't, as the nested command list caused the $( ... ) construct to fail. Probably another parsing bug in /bin/sh. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message