diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-08-24 21:24:07 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-08-24 21:24:07 +0000 |
commit | 14bc4e87fbd5911af22bf927d5e63a0857bb299f (patch) | |
tree | 1f43ab19cfdddce2fafd4a24bfe9cfd12151236a /usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | |
parent | 223f7a614a5af684743f83087563224d4e78152e (diff) |
URI-decode the filenames in the listing used for HTTP pkg_add updates.
Fixes a problem with pkg_add -u where package names are encoded in the
listing (e.g. those containing + like gtk+2-2.16.5 on standards-compliant
servers).
Problem noted and fix tested by ajacoutot@ against a server running
lighttpd. No regressions against Apache. ok espie@
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageRepository.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 6decdbf0ff3..8972a44d788 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageRepository.pm,v 1.66 2009/05/11 19:51:27 sthen Exp $ +# $OpenBSD: PackageRepository.pm,v 1.67 2009/08/24 21:24:06 sthen Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -710,6 +710,8 @@ sub get_http_list chomp; for my $pkg (m/\<A\s+HREF=\"(.*?)\.tgz\"\>/gio) { $pkg = $1 if $pkg =~ m|^.*/(.*)$|; + # decode uri-encoding; from URI::Escape + $pkg =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; push(@$l, $pkg); } } |