(PUP-3604) Rework handling of :ensure with a version

I'll add that shortly, along with tests.