diff options
author | Dave Reisner <dreisner@archlinux.org> | 2014-10-11 16:33:32 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-10-13 12:54:26 +1000 |
commit | 62c11e450a6f7d753fc997c20027472661de04e0 (patch) | |
tree | 1bb666741a4f5a2d93027a14f8139f1d87095bf8 | |
parent | 3f0303dc92634043d561ac9bbefa6c6e57578a65 (diff) | |
download | pacman-62c11e450a6f7d753fc997c20027472661de04e0.tar.xz |
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 <allan@archlinux.org>
-rw-r--r-- | scripts/makepkg.sh.in | 6 |
1 files 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. |