makepkg: less code repetition for empty variable checking
Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
13748ca052
commit
cd042640c6
1 changed files with 7 additions and 12 deletions
|
@ -1156,18 +1156,13 @@ install_package() {
|
|||
|
||||
check_sanity() {
|
||||
# check for no-no's in the build script
|
||||
if [[ -z $pkgname ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgname"
|
||||
return 1
|
||||
fi
|
||||
if [[ -z $pkgver ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgver"
|
||||
return 1
|
||||
fi
|
||||
if [[ -z $pkgrel ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
|
||||
local i
|
||||
for i in 'pkgname' 'pkgrel' 'pkgver'; do
|
||||
if [[ -z ${!i} ]]; then
|
||||
error "$(gettext "%s is not allowed to be empty.")" "$i"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
local name
|
||||
for name in "${pkgname[@]}"; do
|
||||
|
|
Loading…
Add table
Reference in a new issue