diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2017-08-04 11:53:04 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2017-08-04 11:53:04 +0000 |
commit | 5149d83bca275db63ed27fe0d3e83619f592b795 (patch) | |
tree | 7495cd9cbf0a827c87b636c34a330b355a20f3b1 /usr.sbin/pkg_add | |
parent | c6d225fd4b32253757853b39bf2c40a27c989b9e (diff) |
Adjust the html index-parsing regex to cope with anchor tags that aren't
just '<a href="foo">'; several mirrors now include a title attribute which
pkg_add can't cope with.
Diff from Taylor Stearns to handle attributes following the href; tweaked
by me to also handle attribute before the href.
ok zhuk@
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 4 | ||||
-rwxr-xr-x | usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 4b85b415f88..c9a87710eef 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.145 2017/06/20 18:05:44 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.146 2017/08/04 11:53:03 sthen Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -912,7 +912,7 @@ sub get_http_list $error) or return; while(<$fh>) { chomp; - for my $pkg (m/\<A\s+HREF=\"(.*?\.tgz)\"\>/gio) { + 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; diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm index 2e2727f3c95..ea4fea212cc 100755 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/HTTP.pm @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: HTTP.pm,v 1.12 2014/08/27 18:40:03 kspillner Exp $ +# $OpenBSD: HTTP.pm,v 1.13 2017/08/04 11:53:03 sthen Exp $ # # Copyright (c) 2011 Marc Espie <espie@openbsd.org> # @@ -280,7 +280,7 @@ sub get_directory exit 1; } print "SUCCESS: directory $dname\n"; - for my $pkg ($r =~ m/\<A\s+HREF=\"(.+?)\.tgz\"\>/gio) { + for my $pkg ($r =~ 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; |