[PATCH 49/58] buildman: Move bulid code into its own function