[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#540863: ddpo: multiple versions in NEW break links



tag 540863 + patch
thanks

On Mon, Aug 10, 2009 at 06:35:04PM +0100, Jonathan Wiltshire wrote:
> Packages with multiple versions in NEW, for example get-iplayer (at the time
> of writing) have corrupted links to the queue:
> 
> http://ftp-master.debian.org/new/get-iplayer_2.15-1%202.09-1.html
> 
> This link refers to versions 2.15-1 and 2.09-1, for posterity.

new.822 uses one stanza per-source even if there have been multiple
versions uploaded, so you end up with the following:

Source: get-iplayer
Version: 2.15-1 2.09-1
Architectures: source, all
Age: 3 weeks
Last-Modified: 1247867224
Queue: new
Maintainer: Jonathan Wiltshire <debian@jwiltshire.org.uk>
Changed-By: Jonathan Wiltshire <debian@jwiltshire.org.uk>
Sponsored-By: mez@debian.org
Distribution: unstable
Fingerprint: BE1ABF206C3AF082423D40112404ED3A6AAAA569
Closes: #512754
Changes-File: get-iplayer_2.15-1_amd64.changes

Multiple versions listed in the Version field aren't handled by
extract_incoming.pl.  Since the order of the versions isn't consistent,
we can't simply split on whitespace and use the first version in the
resulting list.  It'd be best to sort the given versions and use the
newest.  Attached patch does this, assuming dpkg-dev is available.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@debian.org>
Index: extract_incoming.pl
===================================================================
--- extract_incoming.pl	(revision 2259)
+++ extract_incoming.pl	(working copy)
@@ -35,6 +35,7 @@
 
 use strict;
 use DB_File;
+use Dpkg::Version;
 use Mail::Header;
 use URI::Escape;
 
@@ -174,9 +175,11 @@
 	$db{"os-pu_new-title:$source"} = mouseover_date($date, $changedby, $uploader);
 	$db{"os-pu_new-url:$source"} = "http://release.debian.org/proposed-updates/oldstable_diffs/"; . uri_escape ("${source}_$noepochversion.debdiff");
     } elsif ($queue =~ /^(new|byhand)$/) {
-	$db{"n${d}:$source"} = "$queue:&nbsp;$version";
+	my @versions = sort Dpkg::Version::vercmp split(/\s+/, $version);
+	my $newest = $versions[-1];
+	$db{"n${d}:$source"} = "$queue:&nbsp;$newest";
 	$db{"n${d}-title:$source"} = mouseover_date($date, $changedby, $uploader);
-	my $url = "http://ftp-master.debian.org/new/"; . uri_escape ("${source}_$version.html");
+	my $url = "http://ftp-master.debian.org/new/"; . uri_escape ("${source}_$newest.html");
 	$db{"n${d}-url:$source"} = $url;
     } else {
 	$db{"n${d}:$source"} = "new:&nbsp;$version";

Attachment: signature.asc
Description: Digital signature


Reply to: