[buildifier] Fix verify.sh script.

`buildifier --version` now reports `6.1.2` instead of `v6.1.2`
as previously, which breaks the verify.sh script so modify the
latter to accept both forms.

NOte that this also fixes the buildozer recipe which uses the
same verification script through a symlink (and comes from the
same release page).

Bug: None
Change-Id: Idef2ada30148be5df197eab28f107d7dabe94340
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/3pp/+/857876
Commit-Queue: David Turner <digit@google.com>
Reviewed-by: Catherine Duncan <catduncan@google.com>
diff --git a/buildifier/verify.sh b/buildifier/verify.sh
index ca7f5f1..dd55341 100755
--- a/buildifier/verify.sh
+++ b/buildifier/verify.sh
@@ -23,7 +23,20 @@
   exit 1
 fi
 
-if [[ "${_3PP_VERSION#${VERSION}}" == "${_3PP_VERSION}" ]]; then
+# The version computed by fetch.py is something like `v6.1.2` extracted
+# from the official release download pages, but the tool now reports
+# a version without the 'v' prefix (e.g. 6.1.2). Support both formats
+# just in case:
+VERSION_MATCHES=
+if [[ "${_3PP_VERSION}" == "${VERSION}" ]]; then
+  # Exact match
+  VERSION_MATCHES=true
+elif [[ "${_3PP_VERSION#v}" == "${VERSION}" ]]; then
+  # _3PP_VERSION includes a v prefix, but matches the version otherwise.
+  VERSION_MATCHES=true
+fi
+
+if [[ -z "${VERSION_MATCHES}" ]]; then
   echo >&2 "Invalid ${TOOL} version (${VERSION}), does not match ${_3PP_VERSION}"
   exit 1
 fi