build: factor-out snarfing.