[pacman-dev] [PATCH 2/2] makepkg: Allow install/changelog decls to be arrays

Dave Reisner d at falconindy.com
Sun Oct 9 23:35:50 EDT 2011


This doesn't actually change the treatment of install and changelog
varaibles, but it allows valid bash syntax to get by our parsing of
these variables.

Fixes FS#25827.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
This is getting pretty ugly... I'm still 50/50 on whether or not we should do
this. I will point out that if we choose not to merge this, there's a dozen or
so packages in extra/community that need to be fixed:

$ grep -lE '^(install|changelog)=\(' /var/abs/*/*/PKGBUILD

And just because I'm getting a little paranoid about making changes this close
to release, here's the test rig I used to proof this patch:

http://paste.xinu.at/XcbR/

Allan, thoughts?

 scripts/makepkg.sh.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 84221d0..f2ad16d 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1537,7 +1537,7 @@ check_sanity() {
 		local file
 		while read -r file; do
 			# evaluate any bash variables used
-			eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
+			eval file=\"$(sed 's/^(\(.*\))$/\1/;s/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
 			if [[ $file && ! -f $file ]]; then
 				error "$(gettext "%s file (%s) does not exist.")" "$i" "$file"
 				ret=1
-- 
1.7.7



More information about the pacman-dev mailing list