libspec: provide a better workaround for rpm segfaults when evaluating urls with '%' characters
This commit is contained in:
parent
55df4cbe08
commit
fa9b236d17
@ -564,10 +564,12 @@ $FUNCNAME: * blank unexpanded and undefined variables beginning by \`?'..."
|
|||||||
# i.e. 'rpmvars.solve(%{__install_info} $specfile)'
|
# i.e. 'rpmvars.solve(%{__install_info} $specfile)'
|
||||||
case "$output" in *%*)
|
case "$output" in *%*)
|
||||||
notify.debug "$FUNCNAME: * expanding rpm variables, if any..."
|
notify.debug "$FUNCNAME: * expanding rpm variables, if any..."
|
||||||
# FIXME: hack to prevent a rpm segfault when parsing '%' with --eval
|
# hack to prevent a rpm segfault when evaluating urls containing '%' (e.g. python-pyslsk)
|
||||||
output=$(echo $output | sed "s@\%@\\\%@g;")
|
output_prefix=`echo ${output} | sed "s|\(^[a-z]://\)|\1|"`
|
||||||
output=$(rpm --eval "$output")
|
output_suffix=${output/$output_prefix}
|
||||||
output=$(echo $output | sed "s@\\\%@%@g;")
|
notify.debug "$FUNCNAME: rpm --eval \"${output_suffix}\""
|
||||||
|
output=$(rpm --eval "${output_suffix}")
|
||||||
|
output="${output_prefix}${output}"
|
||||||
notify.debug "$FUNCNAME: output = \`$output'" ;;
|
notify.debug "$FUNCNAME: output = \`$output'" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user