Simplify build_tools/build_detect_version