Hi Steve

I've modified your patch slightly to show the repo that a Ubuntu package
comes from (eg. universe) and included it in 0.21-4. It's attached.

Jonathan




-- 
Jonathan Wiltshire

PGP/GPG: 0xDB800B52 / 4216 F01F DCA9 21AC F3D3  A903 CA6B EA3E DB80 0B52
Sending of encrypted mail is encouraged

#! /bin/sh /usr/share/dpatch/dpatch-run
## 06-ubuntu-versions-510203.dpatch by  <deb...@jwiltshire.org.uk>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Patch to show all versions of a package from Ubuntu, not just
## DP: the earliest, see bug 510203.
## DP: Additionally, show the repo that the package is from (eg. universe)
## DP: Original patch from Steve Cotton <steve0...@s.cotton.clara.co.uk>
## DP: Status: forwarded upstream to Philipp Wesche <phi1...@yahoo.com>

@DPATCH@
diff -urNad whohas-0.21~/whohas whohas-0.21/whohas
--- whohas-0.21~/whohas 2008-12-31 00:32:05.000000000 +0000
+++ whohas-0.21/whohas  2008-12-31 00:32:22.000000000 +0000
@@ -279,19 +279,26 @@
        my @groups;
        my $now = 0;
        for (my $i = 0; $i<@lines; $i++) {
-               if ($lines[$i] =~ /<h3>Package /) {
-                       my $name = (split /h3>Package |<\/h3>/, $lines[$i])[1];
-                       push @names, $name;
-                       my @parts = split /href\=\"|\"\>|<\/a\>/, $lines[$i+3];
-                       $parts[4] =~ s/ \(|\)://g;
-                       push @groups, $parts[4];
-                       push @repos, "";
-                       push @urls,  $base.$parts[2];
-                       push @sizes, "";
-                       push @dates, "";
-                       @parts = split />|: /, $lines[$i+6];
-                       push @versions, $parts[1];
-                       $i += 11;
+               (my $name) = ($lines[$i] =~ /<h3>Package (.+)<\/h3>/);
+               if ($name) {
+                       $i += 3;
+                       # There are now one or more 8-line blocks that are 
approximately
+                       # $lines[$i]   <li class="intrepid"><a 
class="resultlink" href="/intrepid/dpkg">intrepid</a> (base):
+                       # $lines[$i+3] <br>1.14.20ubuntu6: amd64 i386
+                       while ($lines[$i] =~ /class="resultlink"/) {
+                               push @names, $name;
+                               my @parts = split /href\=\"|\"\>|<\/a\>/, 
$lines[$i];
+                               $parts[4] =~ s/ \(|\)://g;
+                               push @groups, $parts[4];
+                               push @urls,  $base.$parts[2];
+                               push @sizes, "";
+                               push @dates, "";
+                               @parts = split />|<\/strong>/, $lines[$i+1];
+                               push @repos, $parts[1];
+                               @parts = split />|: /, $lines[$i+3];
+                               push @versions, $parts[1];
+                               $i += 8;
+                       }
                }
        }
        for (my $i = 0; $i < @repos; $i++) {

Attachment: signature.asc
Description: Digital signature

Reply via email to