Skip to content

Commit fe1fc7e

Browse files
committed
handle pure tags in version comparison
1 parent 1114797 commit fe1fc7e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

ci-before-build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ else
1515
version=$(grep "^version =" pyproject.toml | sed 's/version = "//;s/"//')
1616
fi
1717

18-
# Sanity check, strip off the last (build) number from version, convert - to . in OPENBLAS_COMMIT
19-
if [[ "${OPENBLAS_COMMIT//-/.}" != *"${version%.*}"* ]]; then
18+
obcommit=$OPENBLAS_COMMIT
19+
# add .0 if OPENBLAS_COMMIT is an actual tag
20+
[[ "$obcommit" == *-* ]] || obcommit="$obcommit.0"
21+
22+
# convert - to . in OPENBLAS_COMMIT
23+
# strip off the last (build) number from version
24+
if [[ "${obcommit//-/.}" == *"${version%.*}"* ]]; then
2025
echo "OPENBLAS_COMMIT $OPENBLAS_COMMIT does not match the pyproject.toml version $version"
2126
exit -1
2227
fi

0 commit comments

Comments
 (0)