@@ -60,7 +60,8 @@ systems (see below).
allows package maintainers to make updates to the package's configure
flags, for example. This is typically set to '1' for each new upstream
software release and incremented for intermediate PKGBUILD updates. The
- variable is not allowed to contain hyphens.
+ variable is not allowed to contain colons, forward slashes, hyphens or
+ whitespace.
*epoch*::
Used to force the package to be seen as newer than any previous versions
@@ -35,8 +35,8 @@ lint_pkgrel() {
return 1
fi
- if [[ $pkgrel != +([0-9])?(.+([0-9])) ]]; then
- error "$(gettext "%s must be a decimal, not %s.")" "pkgrel" "$pkgrel"
+ if [[ $pkgrel = *[[:space:]/:-]* ]]; then
+ error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace.")" "pkgrel" "$pkgrel"
return 1
fi
}
@@ -39,7 +39,7 @@ tap_runtest() {
tap_is_str "$($bin "$ver2" "$ver1")" "$exp" "$ver2 $ver1"
}
-tap_plan 92
+tap_plan 124
# all similar length, no pkgrel
tap_runtest 1.5.0 1.5.0 0
@@ -113,4 +113,25 @@ tap_runtest 1:1.0 1.0 1
tap_runtest 1:1.0 1.1 1
tap_runtest 1:1.1 1.1 1
+# complex pkgrel values
+tap_runtest 1-1.5.0 1-1.5.0 0
+tap_runtest 1-1.5.1 1-1.5.0 1
+tap_runtest 1-1.5.1 1-1.5 1
+tap_runtest 1-1.5b 1-1.5 -1
+tap_runtest 1-1.5b 1-1.5.1 -1
+# based on "from the manpage"
+tap_runtest 1-1.0a 1-1.0alpha -1
+tap_runtest 1-1.0alpha 1-1.0b -1
+tap_runtest 1-1.0b 1-1.0beta -1
+tap_runtest 1-1.0beta 1-1.0rc -1
+tap_runtest 1-1.0rc 1-1.0 -1
+# based on "going crazy? alpha-dotted versions"
+tap_runtest 1-1.5.a 1-1.5 1
+tap_runtest 1-1.5.b 1-1.5.a 1
+tap_runtest 1-1.5.1 1-1.5.b 1
+# based on Parabola usage
+tap_runtest 1-1 1-2.par1 -1
+tap_runtest 1-2 1-2.par1 -1
+tap_runtest 1-3 1-2.par1 1
+
tap_finish