Portfile Workflow Advice

Ryan Schmidt ryandesign at macports.org
Tue Jan 15 21:10:39 PST 2013


On Jan 15, 2013, at 23:02, Sean Farley wrote:
> On Tue, Jan 15, 2013 at 10:48 PM, Ryan Schmidt wrote:
>> On Jan 15, 2013, at 13:17, Sean Farley wrote:
>>> For me, this command takes:
>>> 
>>> $ time find $MP/dports -maxdepth 3 -name Portfile -exec echo {} \;
>>> -exec grep -E -- "AUTHORS" {} \; | grep -B1 -v -E "/Portfile"
>>> 
>>> real 1m2.393s
>>> user 0m18.293s
>>> sys 0m19.905s
>> 
>> I really love my new Mac's SSD. Makes grepping all the portfiles much faster. It took several minutes on my old Mac. The above took 15s for me just now.
> 
> Huh. I have a ssd as well (a new macbook pro, actually) so I don't see
> why it would be an order of magnitude faster for you. Odd. I wonder if
> something's cached?

Oops, I neglected to remove the newline before pasting into the terminal so I only ran the first line. Running the full command gets about the same times as you:

real	1m18.696s
user	0m16.514s
sys	0m18.815s

However the command I would usually run is faster:

$ time find $MP/dports -name Portfile | xargs grep AUTHORS

real	0m5.767s
user	0m0.368s
sys	0m3.315s


>> How and when is the csearch index updated? I like that grep gets me completely up-to-date results every time.
> 
> It's manual but cindex updates itself in ~7s (depending on the number
> of changed files) for me and is more than just macports (it's all my
> code on my hard drive, in fact). I usually run it after pulling new
> changes. But really, for me at least, code doesn't change fast enough
> for me to care about hitting false-postives or whatnot; plus what I'm
> usually searching for is an example so all I really want is the
> location of a handful of files.

That is true.



More information about the macports-dev mailing list