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

handling the oldstable mirror case on packages.d.o



On Thu, Mar 01, 2007 at 02:12:59PM +0100, Matt Kraai wrote:
> On Thu, Mar 01, 2007 at 09:16:12AM +0100, Simon Paillard wrote:
> > To the list: is there a way to specify a different set of mirrors for
> > oldstable ? 
> 
> The scripts that are used to generate packages.debian.org can be found
> at http://cvs.debian.org/packages/?root=webwml
> 
> if you're interested in fixing this problem.

Here is a patch that should fix this problem.

It adds "&dist=oldstable" to the url if necessary, then download.cgi
displays the correct mirrors.

Does someone see a problem ? Otherwise I will commit it.

BTW, I will update http://www.debian.org/distrib/archive

regards,

-- 
Simon Paillard
Index: cgi-bin/download.pl
===================================================================
RCS file: /cvs/webwml/packages/cgi-bin/download.pl,v
retrieving revision 1.31
diff -u -r1.31 download.pl
--- cgi-bin/download.pl	13 Dec 2006 14:57:07 -0000	1.31
+++ cgi-bin/download.pl	2 Mar 2007 18:55:03 -0000
@@ -150,6 +150,17 @@
 	"ftp.cl.debian.org/debian-non-US",
 	);
 
+my @old_european_sites = (
+	"ftp.de.debian.org/debian-archive",
+	"ftp.nl.debian.org/debian-archive",
+	"ftp.ch.debian.org/debian-archive",
+	);
+
+my @old_north_american_sites = (
+	"archive.debian.org",
+	"ftp3.nrc.ca/debian-archive",
+	);
+
 # list of architectures
 my %arches = (
         i386    => 'Intel x86',
@@ -187,6 +198,8 @@
 @file_components = split('/', $file);
 $filen = pop(@file_components);
 
+$dist = $input->param('dist');
+
 $md5sum = $input->param('md5sum');
 param_error( "md5sum" ) unless defined $md5sum;
 # Make md5sum fit in a regexp
@@ -278,6 +291,16 @@
 <a href="http://www.debian.org/mirror/list-non-US";>complete mirror list</a>.</p>
 END
 
+} elsif ($dist eq 'oldstable') {
+
+    print_links( "North America", $file, @old_north_american_sites );
+    print_links( "Europe", $file, @old_european_sites );
+
+    print <<END;
+<p>If none of the above sites are fast enough for you, please see our
+<a href="http://www.debian.org/distrib/archive/";>complete mirror list</a>.</p>
+END
+
 } elsif ($type eq 'volatile') {
 
 #    print_links( "North America", $file, @nonus_north_american_sites );
Index: htmlscripts/pages.pl
===================================================================
RCS file: /cvs/webwml/packages/htmlscripts/pages.pl,v
retrieving revision 1.68
diff -u -r1.68 pages.pl
--- htmlscripts/pages.pl	1 Mar 2007 19:52:16 -0000	1.68
+++ htmlscripts/pages.pl	2 Mar 2007 18:55:05 -0000
@@ -238,6 +238,9 @@
 		$package_page .=  "&amp;file=".uri_escape($filenames{a2f}->{$a});
 		$package_page .=  "&amp;md5sum=$file_md5s{a2f}->{$a}";
 		$package_page .=  "&amp;arch=$a";
+		if ($env->{distribution} eq "oldstable") {
+		$package_page .=  "&amp;dist=$env->{distribution}";
+		}
 		my $unofficial = '';
 		if (($a =~ /^kfreebsd/) ||
 			(($env->{distribution} eq "stable") &&

Reply to: