From 62c11e450a6f7d753fc997c20027472661de04e0 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 11 Oct 2014 16:33:32 -0400 Subject: makepkg: simplify attr matching in extract_function_var Interesting attributes created with 'local' or 'declare' won't be surfaced in .PKGINFO, so we shouldn't try to look for them. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 90822067..4a3ae2ee 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2398,14 +2398,14 @@ extract_function_var() { local funcname=$1 attr=$2 isarray=$3 outputvar=$4 attr_regex= decl= r=1 if (( isarray )); then - printf -v attr_regex '^[[:space:]]*(declare( -[[:alpha:]])*)? %q\+?=\(' "$2" + printf -v attr_regex '^[[:space:]]* %s\+?=\(' "$2" else - printf -v attr_regex '^[[:space:]]*(declare( -[[:alpha:]])*)? %q\+?=[^(]' "$2" + printf -v attr_regex '^[[:space:]]* %s\+?=[^(]' "$2" fi while read -r; do # strip leading whitespace and any usage of declare - decl=${REPLY##*([[:space:]])?(declare +(-+([[:alpha:]]) ))} + decl=${REPLY##*([[:space:]])} eval "${decl/#$attr/$outputvar}" # entering this loop at all means we found a match, so notify the caller. -- cgit v1.2.3-70-g09d2