pacman/scripts/libmakepkg/lint_pkgbuild
Eli Schwartz 30e3e21e87 libmakepkg/lint_pkgbuild: check for invalid variables even if they're empty
Checking the length of the variable to be non-zero before considering it
an error is inconsistent; license=() and depends='' and `declare arch`
should be considered just as wrong.

In fact the current check detects depends='' as non-zero and returns an
error, but happily considers the others to be perfectly okay.

A more reliable check is to simply see if the name has been declared
(whether it is set or not), and then enforce that it's been declared to
the right type.

As an added benefit, avoiding the creation of proxy-evaled variables to
count the number of indexes results in simpler code.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2019-01-10 15:21:13 +10:00
..
arch.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
backup.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
changelog.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
checkdepends.sh.in libmakepkg: only save the shellopts we need 2018-05-12 21:11:52 +10:00
conflicts.sh.in libmakepkg: only save the shellopts we need 2018-05-12 21:11:52 +10:00
depends.sh.in makepkg: reduce strictness of pkgver in depends linting 2018-07-27 10:21:58 +10:00
epoch.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
install.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
makedepends.sh.in libmakepkg: only save the shellopts we need 2018-05-12 21:11:52 +10:00
meson.build Add meson.build files to build with meson 2018-11-02 03:16:34 -04:00
optdepends.sh.in libmakepkg/lint_pkgbuild: permit versioned optdepends 2018-06-18 13:15:51 +10:00
options.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
package_function.sh.in makepkg: reject PKGBUILDs with both split and non-split package functions 2018-09-19 11:10:04 +10:00
pkgbase.sh.in libmakepkg/lint_pkgbuild: lint depends/etc. as if they are pkgname 2018-04-29 21:49:05 +10:00
pkglist.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
pkgname.sh.in libmakepkg/lint_pkgbuild: squelch syntax error when a pkgname is empty 2018-06-18 13:15:51 +10:00
pkgrel.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
pkgver.sh.in makepkg: lint_pkgver: Run even if PKGVERFUNC 2018-09-19 18:01:23 +10:00
provides.sh.in libmakepkg/lint_pkgbuild: fix regression in linting depends=(foo=$epoch:$pkgver-$pkgrel) 2018-05-12 21:10:44 +10:00
source.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
util.sh.in Update coyrights for 2018 2018-03-14 13:31:31 +10:00
variable.sh.in libmakepkg/lint_pkgbuild: check for invalid variables even if they're empty 2019-01-10 15:21:13 +10:00