summaryrefslogtreecommitdiff
path: root/scripts/libmakepkg/util/pkgbuild.sh.in
diff options
context:
space:
mode:
authormorganamilo <morganamilo@gmail.com>2019-01-31 02:04:56 +0000
committerAllan McRae <allan@archlinux.org>2019-01-31 15:03:25 +1000
commit14755df06f4727f261a8174502754acd7243ab75 (patch)
treece86c7823c26959c55ccb1f826e8ce3b1bb58b4e /scripts/libmakepkg/util/pkgbuild.sh.in
parent75aae126c423dcc9b215aef57daff9e7bd8f5f6b (diff)
downloadpacman-14755df06f4727f261a8174502754acd7243ab75.tar.xz
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 <morganamilo@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/util/pkgbuild.sh.in')
-rw-r--r--scripts/libmakepkg/util/pkgbuild.sh.in9
1 files changed, 9 insertions, 0 deletions
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