[PATCH 20/58] buildman: Move setting up the output dir into a function