Commit a5f37180 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs: fix download URL with &

parent d57e6310
......@@ -72,7 +72,9 @@ get_archive1()
{
URL=${GETSOURCE/.bz2/}
WEXT=`basename "$URL"`
test -f "$WEXT.$1" download_url "$URL.$1" || return
[ -n "$FORCEDOWNLOAD" ] && docmd rm -f "$WEXT.$1"
test -f "$WEXT.$1" && echog "$WEXT.$1 already exists" && return
download_url "$URL.$1" || return
test -f "$WEXT.$1" || return
echog -n "Converting to $WEXT.bz2..."
}
......@@ -225,6 +227,8 @@ function source_ext()
local TMPSPEC=$1.tmpurl
local NEWSOURCE=$(grep "# Source$3-$2:" "$1" | sed -e "s/.*$2:[ \t]*//g")
test -n "$NEWSOURCE" || fatal "Can't extract URL from $Source$3-$2"
# Fake replace for correct subst variables
NEWSOURCE="$(echo "$NEWSOURCE" | sed -e 's|\&|\\&|g')"
cat $1 | sed -e "s|^Summary:.*|Summary: $NEWSOURCE|g" > $TMPSPEC
GETSOURCEEXT=$(eval_spec "$TMPSPEC" | get_var "Summary")
rm -f "$TMPSPEC"
......
#!/bin/sh
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$2' do not match with '$3'" || echo "OK for '$1' with '$2'"
}
RESTEXT="Summary: test & test"
RT="$(echo "$RESTEXT" | sed -e 's|\&|\\&|g')"
check "sed with &" "$(echo "Summary: test" | sed -e "s|Summary: .*|$RT|g")" "$RESTEXT"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment