Add extra validation of our package version format in the build scripts,
authorWard Vandewege <ward@curii.com>
Fri, 30 Jul 2021 17:27:35 +0000 (13:27 -0400)
committerWard Vandewege <ward@curii.com>
Fri, 30 Jul 2021 17:31:32 +0000 (13:31 -0400)
it must match

  ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+|)(~rc[0-9]+|~dev[0-9]+|)-[0-9]+$

No issue #

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

build/run-build-packages-one-target.sh

index 056a1fbb1216a2742a5d90e2165db0798a1d2d1e..81aac9c616c11ea2894482b240c08495a577511d 100755 (executable)
@@ -106,6 +106,9 @@ while [ $# -gt 0 ]; do
             elif ! [[ "$2" =~ (.*)-(.*) ]]; then
                 echo >&2 "FATAL: --build-version '$2' does not include an iteration. Try '${2}-1'?"
                 exit 1
+            elif ! [[ "$2" =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+|)(~rc[0-9]+|~dev[0-9]+|)-[0-9]+$ ]]; then
+                echo >&2 "FATAL: --build-version '$2' is invalid, must match pattern ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+|)(~rc[0-9]+|~dev[0-9]+|)-[0-9]+$"
+                exit 1
             else
                 ARVADOS_BUILDING_VERSION="${BASH_REMATCH[1]}"
                 ARVADOS_BUILDING_ITERATION="${BASH_REMATCH[2]}"