From 14755df06f4727f261a8174502754acd7243ab75 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Thu, 31 Jan 2019 02:04:56 +0000 Subject: libmakepkg: lint disallowed variables in package() makepkg will now error if disallowed variables are set inside of the package function. Disallowed variables are variables that do exist, like 'makedepends' and 'pkgver' but can not be set inside of a package function. Signed-off-by: morganamilo Signed-off-by: Allan McRae --- scripts/libmakepkg/util/pkgbuild.sh.in | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/libmakepkg/util/pkgbuild.sh.in') diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b/scripts/libmakepkg/util/pkgbuild.sh.in index 0dc239d1..298275a8 100644 --- a/scripts/libmakepkg/util/pkgbuild.sh.in +++ b/scripts/libmakepkg/util/pkgbuild.sh.in @@ -100,6 +100,15 @@ extract_function_variable() { return $r } +exists_function_variable() { + # $1: function name + # $2: variable name + + local funcname=$1 attr=$2 out + extract_function_variable "$funcname" "$attr" 0 out || + extract_function_variable "$funcname" "$attr" 1 out +} + get_pkgbuild_attribute() { # $1: package name # $2: attribute name -- cgit v1.2.3-54-g00ecf