summaryrefslogtreecommitdiffstats
path: root/scripts/libmakepkg/lint_pkgbuild
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-05-12 15:46:36 +0200
committerAllan McRae <allan@archlinux.org>2015-05-16 06:10:42 +0200
commit9302593cfb8a5a845dab501cfaef71ea5d54933a (patch)
treee85cb1ee47399b3b822b1076fd3612bf6ec17dac /scripts/libmakepkg/lint_pkgbuild
parentc9a7b7e0bf6a5768f6ca433dc14a3344899bb0cd (diff)
downloadpacman-9302593cfb8a5a845dab501cfaef71ea5d54933a.tar.gz
pacman-9302593cfb8a5a845dab501cfaef71ea5d54933a.tar.xz
makepkg: merge validate_pkgver into check_pkgver
The check that pkgver is non-empty done in check_pkgver should also be performed after running the pkgver() function. Merge validate_pkgver into check_pkgver and run check_pkgver after updating pkgver. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/lint_pkgbuild')
-rw-r--r--scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in12
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in
index d23f7043..3fa4ff7d 100644
--- a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in
@@ -29,20 +29,16 @@ source "$LIBRARY/util/message.sh"
lint_pkgbuild_functions+=('lint_pkgver')
-validate_pkgver() {
- if [[ $1 = *[[:space:]:-]* ]]; then
- error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
- return 1
- fi
-}
-
check_pkgver() {
if [[ -z ${pkgver} ]]; then
error "$(gettext "%s is not allowed to be empty.")" "pkgver"
return 1
fi
- validate_pkgver "$pkgver"
+ if [[ $1 = *[[:space:]:-]* ]]; then
+ error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
+ return 1
+ fi
}
lint_pkgver() {