Another commit to NPM

Well this was a fun one, for the first night in quite awhile I’ve spent some code-time on one of my own projects instead of [SAS] related business.

After someone on daemonforums pointed me at a few make targets (depends-list, showconfig). I put it on my to do list to refactor NPM to make use of such things.

As it turns out, depends-list is not documented and doesn’t seem to work on every port. The included makefile that implements showconfig however, does list a lot of make targets that I can count on (more then the ports manual page), including suitable *-depends-list targets.

NPM’s way of handling port build options in the trunk, I’ve never been very happy with… Because although it works, the whole thing hinges on a method of pulling out the OPTIONS variable from a specified ports Makefile. The code to do it, should we say gives me a queezy feeling when I think about it.

I also had planned on writing a small module to handle calculating a programs dependencies through the ports INDEX file but never finished it. I had gotten as far as processing the index and scratching my head over a couple of the rarely used segments of the file. The various m/.*-depends-.*/ targets solve that problem already, so we’re in cake land 😉

It’s much easier to just read the information through a pipe and process it into something manageable. I’m to exhausted atm to keep working on things in a sound frame of mind… Else I would probably be awake for another 3 or 4 hours, passing out around 0700~0800.

Some stuff I would like to do on the next round of commits,

process data received from the pipes while reading them, not after reading it all (not that this is likely to be a noticeable improvement in response time for big jobs)

figure out exceptions to be raised

get it finished

get it tested

get the program using it

test that

pass out again.