Downloads: implement proper URL hex substitution.

Remove the old code for replacing hex codes in URLs
(like %2B for '+') and add a generic code replacing
any %xy sequence with the proper character.

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-01-22 16:45:29 +00:00
parent 102d89c316
commit 459c36864a

View file

@ -1760,8 +1760,12 @@ build_package () {
. $PKG.info.build . $PKG.info.build
PKGNAME=${PKG##*/} PKGNAME=${PKG##*/}
SRCNAME=${DOWNLOAD##*/} SRCNAME=${DOWNLOAD##*/}
SRCNAME=$(echo $SRCNAME | sed -e 's/\%2B/\+/g') # TiMidity fix for '+' # Replace URL hex sequences (like %20 for ' ' and %2B for '+')
SRCNAME=$(echo $SRCNAME | sed -e 's/\%20/ /g') # Fix for spaces SRCNAME=$(echo "echo $SRCNAME" \
|sed "s/%\(..\)/\$(printf \"\\\\x\\1\")/g" |bash)
# FIXME CLEANUP This is old stuff, and should be deleted
# SRCNAME=$(echo $SRCNAME | sed -e 's/\%2B/\+/g') # TiMidity fix for '+'
# SRCNAME=$(echo $SRCNAME | sed -e 's/\%20/ /g') # Fix for spaces
if [ "$PKG" = "django" ]; then if [ "$PKG" = "django" ]; then
SRCNAME="Django-$VERSION.tar.gz" SRCNAME="Django-$VERSION.tar.gz"
fi fi