Unify version detection

A previous attempt at making the package build work without being in a
git repository ended up duplicating quite a lot of code.  This change
refactors that original effort so that it re-uses the BuildpackVersion
logic that already existed.

[#69076566]
Merge 69076566-no-git-repository to master

[Completes #69076566]