K.Mandla's blog of Linux experiences

My dumbest trick yet

This is one of those things that I will probably be looking for again in the future, no matter how lame it seems right now.

I like to keep local copies of the source code for the software I have on Crux systems, just because if something breaks and I am not online, then it helps to get things going again. It’s also useful if network speeds are slow or if there’s a problem getting a particular source package with the proper checksum.

On the other hand, that tends to take up a lot of space, particularly if there’s a large library or compile-time dependency involved. ocaml, for example, is a gargantuan beast that’s only really necessary to compile wyrd. Once it’s been built, I don’t need ocaml ever again.

So to save space I sometimes have to remove source packages (which can be neatly done with prt-utils’ prtwash -a -s command), but it makes me itchy.

So I decided today to get all the source packages back from the applications I’d installed and then cleared out, as a precautionary measure. pkgmk has a -do flag, which just gets the package but doesn’t do anything with it.

But I don’t think you can give pkgmk the name of a program to build; it has to be executed from the port directory, where it reads the Pkgfile and goes to work.

Now prt-get has a path command, which spits out the full path of a package, and that means I can cd into a path‘d directory and issue the pkgmk -do command.

If I can get a proper list of all the packages on the system, that is. prt-get to the rescue again, with the wonderfully sparse listinst command. Ergo: