linter: fix detecting invalid versions

This commit is contained in:
Leonid Pliushch 2021-12-26 17:40:05 +02:00
parent f3ce15f951
commit b048650736
No known key found for this signature in database
GPG Key ID: 45F2964132545795

View File

@ -168,10 +168,11 @@ lint_package() {
echo -n "TERMUX_PKG_VERSION: "
if [ -n "$TERMUX_PKG_VERSION" ]; then
if grep -qiP '^[0-9][0-9a-z+\-\.]*' <<< "$TERMUX_PKG_VERSION"; then
if grep -qiP '^([0-9]+\:)?[0-9][0-9a-z+\-\.]*$' <<< "$TERMUX_PKG_VERSION"; then
echo "PASS"
else
echo "INVALID (contains characters that are not allowed)"
pkg_lint_error=true
fi
else
echo "NOT SET"