From 55df4cbe0871026797419d2caa1cac7e418a7d6c Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 19 Jul 2011 16:07:53 +0200 Subject: [PATCH] libspec: quote '%' characters before passing strings to rpm --eval to avoid a segmentation fault error --- lib/libspec.lib.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libspec.lib.in b/lib/libspec.lib.in index 0264167..5eb1eb4 100644 --- a/lib/libspec.lib.in +++ b/lib/libspec.lib.in @@ -564,7 +564,10 @@ $FUNCNAME: * blank unexpanded and undefined variables beginning by \`?'..." # i.e. 'rpmvars.solve(%{__install_info} $specfile)' case "$output" in *%*) notify.debug "$FUNCNAME: * expanding rpm variables, if any..." + # FIXME: hack to prevent a rpm segfault when parsing '%' with --eval + output=$(echo $output | sed "s@\%@\\\%@g;") output=$(rpm --eval "$output") + output=$(echo $output | sed "s@\\\%@%@g;") notify.debug "$FUNCNAME: output = \`$output'" ;; esac