Date: Sun, 25 Jul 2010 13:54:56 +0800 From: Aiza <aiza21@comclark.com> To: bf1783@gmail.com Cc: freebsd-questions@FreeBSD.org Subject: Re: searching INDEX in .sh Message-ID: <4C4BD1B0.5080606@comclark.com> In-Reply-To: <AANLkTimTwa8weHJ_iYhuBP4vSBPf%2BD%2BTP2YjVsPv7LhQ@mail.gmail.com> References: <AANLkTimTwa8weHJ_iYhuBP4vSBPf%2BD%2BTP2YjVsPv7LhQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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=<insert PKGNAME of port A here> > display=name,path`, and `make -C $PORTSDIR search rdeps=<insert > 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 > <insert PKGORIGIN of port A here> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C4BD1B0.5080606>