Bug 957247

Implement the v1 cartridge's pre-build logic into pre-receive hook.