[pacman-dev] [PATCH] makepkg: check for value before using eval'd var

Dave Reisner d at falconindy.com
Thu Nov 10 06:12:04 EST 2011


This prevent bsdtar from exploding when install= or changelog= are
present without a value.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 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 5d048d2..085fbb9 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1348,7 +1348,7 @@ create_srcpackage() {
 		while read -r file; do
 			# evaluate any bash variables used
 			eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
-			if [[ ! -f "${srclinks}/${pkgbase}/$file" ]]; then
+			if [[ $file && ! -f "${srclinks}/${pkgbase}/$file" ]]; then
 				msg2 "$(gettext "Adding %s file (%s)...")" "$i" "${file}"
 				ln -s "${startdir}/$file" "${srclinks}/${pkgbase}/"
 			fi
-- 
1.7.7.3



More information about the pacman-dev mailing list