Shell script to uninstall ports with dependents

Before we begin, I seem to be getting a lot of people visiting this post when searching for “uninstall macports”. Read 2.5 Uninstall from the MacPorts Guide you want to uninstall MacPorts itself.

EDIT: steve k wrote in and opened my eyes to:

sudo port uninstall --follow-dependents portname

So use that instead, and read on only if you like bash.

(I have another script that does the inverse—traverses up the dependency chain removing ‘leaf’ nodes—that is, ports with no further dependencies. Maybe I’ll make a new post on that one—after making sure it’s also not already available as some hidden option. :p )
Continue reading

Using the Subversion Ruby Bindings

I work with a distributed team of Ruby (on Rails) developers, and we use Subversion as our repository of choice. Just recently, I wanted to find out which files were recently changed or added to a particular directory of our project.

Doing it manually would’ve been tedious. I also wanted to do it with code so that maybe sometime in the future we might be able to script some behavior depending on the last changed date of a file or group of files in our repository.

I could’ve resorted to merely calling svn info and parsing its output, but I thought maybe this was a good excuse to sharpen my Ruby chops and figure out the Subversion Ruby bindings.
Continue reading

Building db44 using MacPorts

MacPorts provides an extremely convenient way to install/uninstall various open-source software packages that have been ported to the Mac. It’s sort of like apt-get for Debian or yum for RH/CentOS/Fedora. For a developer like me who uses (and likes to use) open-source software on the Mac, MacPorts is a godsend.

If you were brought to this article, chances are you’ve encountered the same problem as I have when trying to install certain packages that depend on db44 (Version 4.4 of the Berkeley Data Base library). (Chances are, you’re also running on an Intel Mac like me – as I haven’t seen any complaints from people on PPC Macs)
Continue reading