Revert "Fix dirname invocation so it works on 12.04 too"

This reverts commit de9894526c776ab53532e3ea10f447d700a54cb1.