File archlinux-url-561536.patch of Package whohas
Description: update search URL for Arch repositories
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561536
Author: Guillaume Delacour <gui@iroqwa.org>
Reviewed-by: Jonathan Wiltshire <jmw@debian.org>
Last-Update: 2010-12-05
--- a/program/whohas
+++ b/program/whohas
@@ -1071,7 +1071,8 @@ sub aur {
sub arch {
my $archbase = "http://www.archlinux.org";
- my @lines = split /\n/, &fetchdoc($archbase."/packages/?arch=i686&repo=&q=".$_[0]."&last_update=&limit=all");
+ # if we directly query i686, redirected to the specific package page
+ my @lines = split /\n/, &fetchdoc($archbase."/packages/?repo=&q=".$_[0]."&last_update=&limit=all");
my @repos;
my @names;
@@ -1080,7 +1081,7 @@ sub arch {
my @urls;
my @sizes;
for (my $i = 0; $i < @lines; $i++) {
- if ($lines[$i] =~ /\<tr class\=\"pkgr/) {
+ if ($lines[$i] =~ /\<tr class\=\"odd/) {
for (my $a = 2; $a < 11;$a++) {
my $temp = $lines[$a+$i];
$temp =~ s/.*\<td\>|\<\/td\>//g;
@@ -1088,15 +1089,16 @@ sub arch {
push @repos,$temp;
} elsif ($a == 4) {
push @urls, $archbase.&arch_site_get_url ($lines[$i+$a]);
+ } elsif ($a == 5) {
push @names, &arch_site_ger_cont($lines[$i+$a]);
- } elsif ($a == 6) {
- $temp =~ s/<span style=\".*\">|<\/span>//g;
+ } elsif ($a == 7) {
+ $temp =~ s/<span class=\".*\">|<\/span>//g;
push @versions, $temp;
} elsif ($a == 10) {
push @dates, $temp;
}
}
- # 2 is package group, 5 is description
+ # 2 is package group
push @sizes, "";
$i += 7;
}
@@ -1109,7 +1111,7 @@ sub arch {
sub arch_site_get_url {
my $temp = $_[0];
- $temp =~ s/.*\<a href=\"|\">.*//g;
+ $temp =~ s/.*\<a href=\"|\".*//g;
return $temp;
}