Commit 5cda12c2 authored by Leo's avatar Leo

deal with _rc being allowed but -rc not.

closes #13
parent f88040ec
...@@ -180,7 +180,7 @@ pkgname_has_uppercase() { ...@@ -180,7 +180,7 @@ pkgname_has_uppercase() {
pkgver_has_pkgrel() { pkgver_has_pkgrel() {
[ "$SKIP_PKGVER_HAS_PKGREL" ] && return 0 [ "$SKIP_PKGVER_HAS_PKGREL" ] && return 0
scan '^pkgver=[A-Za-z0-9_\-\.]*[-_]r' 'pkgver must not have -r or _r' scan '^pkgver=[A-Za-z0-9_\-\.]*(-r|_r(?!c))' 'pkgver must not have -r or _r'
} }
ret=0 ret=0
......
...@@ -313,7 +313,7 @@ is_travis() { ...@@ -313,7 +313,7 @@ is_travis() {
assert_match "${lines[0]}" "pkgname must not have uppercase characters" assert_match "${lines[0]}" "pkgname must not have uppercase characters"
} }
@test 'pkgname must not have -rN' { @test 'pkgver must not have -rN' {
cat <<-"EOF" >$apkbuild cat <<-"EOF" >$apkbuild
pkgname=foo pkgname=foo
pkgver=1 pkgver=1
...@@ -350,4 +350,23 @@ is_travis() { ...@@ -350,4 +350,23 @@ is_travis() {
assert_match "${lines[0]}" "pkgver must not have -r or _r" assert_match "${lines[0]}" "pkgver must not have -r or _r"
} }
@test 'pkgver can have _rc but not -rc' {
cat <<-"EOF" >$apkbuild
pkgname=foo
pkgver=1_rc1
EOF
run $cmd $apkbuild
[[ $status -eq 0 ]]
cat <<-"EOF" >$apkbuild
pkgname=foo
pkgver=02-rc1
EOF
run $cmd $apkbuild
[[ $status -eq 1 ]]
assert_match "${lines[0]}" "pkgver must not have -r or _r"
}
# vim: noexpandtab # vim: noexpandtab
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment