From owner-freebsd-questions@FreeBSD.ORG Sun Jul 25 05:55:01 2010 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4121065672 for ; Sun, 25 Jul 2010 05:55:01 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from mail-03.name-services.com (mail-03.name-services.com [69.64.155.195]) by mx1.freebsd.org (Postfix) with ESMTP id 5744C8FC08 for ; Sun, 25 Jul 2010 05:55:01 +0000 (UTC) Received: from [10.0.10.3] ([202.69.172.205]) by mail-03.name-services.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 24 Jul 2010 22:54:06 -0700 Message-ID: <4C4BD1B0.5080606@comclark.com> Date: Sun, 25 Jul 2010 13:54:56 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: bf1783@gmail.com References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Jul 2010 05:54:06.0562 (UTC) FILETIME=[CB0CD420:01CB2BBD] X-Sender: fbsd8@a1poweruser.com Cc: freebsd-questions@FreeBSD.org Subject: Re: searching INDEX in .sh X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2010 05:55:01 -0000 b. f. wrote: >> I'm looking for a snippet of .sh type shell code that searches the >> /usr/ports/INDEX-8 file for dependents. >> >> Just a pointer to a script in the ports system that has this would be >> helpful > > Do you mean that, given port A, you want to find all ports that need > port A in order to be fetched, extracted, patched, built or installed? > Or do you want to find all ports that are needed to fetch, extract, > patch, build or install port A? If the former, you could look at the > parts of ports/Mk/bsd.port.mk that are used by running `make -C > $PORTSDIR search bdeps= > display=name,path`, and `make -C $PORTSDIR search rdeps= PKGNAME of port A here> display=name,path`. If the latter, look at > the parts of ports/Mk/bsd.port.mk that are used by running `make -C > pretty-print-run-depends > pretty-print-build-depends`. Also, parts of the ports-mgmt/portmaster > script used with --index-only may have similar functionality. > > And do you mean to only use the INDEX? Or are you able to use parts > of the port tree? Or the pkg_info utility? > I just found /usr/ports/Tools/scripts/postsearch which uses the /usr/ports/INDEX-8 file as its source to search. This is a perl script but can be used from within in .sh script. Been playing with it and see a big inconsistence in how ports list build-deps and run-deps. Some ports list no build-deps just run-deps and vise-versa and some have same listed list in both. Thinking I will have to take both the build and run deps lists and sort them together and drop dups to create a good list of dependents to allow for the lax enforcement of standards in the Makefile about how to list the ports dependents.