From 14bc4e87fbd5911af22bf927d5e63a0857bb299f Mon Sep 17 00:00:00 2001 From: Stuart Henderson Date: Mon, 24 Aug 2009 21:24:07 +0000 Subject: 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@ --- usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.sbin/pkg_add/OpenBSD/PackageRepository.pm') 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 # @@ -710,6 +710,8 @@ sub get_http_list chomp; for my $pkg (m/\/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); } } -- cgit v1.2.3