summaryrefslogtreecommitdiffstats
path: root/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in')
-rw-r--r--scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in
index f294a3bf..5dc9d3a7 100644
--- a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in
@@ -29,14 +29,19 @@ source "$LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_pkgrel')
-lint_pkgrel() {
- if [[ -z $pkgrel ]]; then
- error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
+check_pkgrel() {
+ local rel=$1 type=$2
+ if [[ -z $rel ]]; then
+ error "$(gettext "%s is not allowed to be empty.")" "pkgrel${type:+ in $type}"
return 1
fi
- if [[ $pkgrel != +([0-9])?(.+([0-9])) ]]; then
- error "$(gettext "%s must be a decimal, not %s.")" "pkgrel" "$pkgrel"
+ if [[ $rel != +([0-9])?(.+([0-9])) ]]; then
+ error "$(gettext "%s must be a decimal, not %s.")" "pkgrel${type:+ in $type}" "$rel"
return 1
fi
}
+
+lint_pkgrel() {
+ check_pkgrel "$pkgrel"
+}