Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Drop support for cdimage mirrors

The specific code for it is not really worth keeping. cdimage mirrors
can not be properly supported simply because of the redirector's design.
  • Loading branch information...
commit e28116775a9f399302a3c2286f81c5c5f3274d1a 1 parent d216193
@rgeissert authored
Showing with 16 additions and 30 deletions.
  1. +2 −2 README
  2. +2 −6 check.pl
  3. +0 −1  demo.html
  4. +11 −20 redir.pl
  5. +1 −1  update.pl
View
4 README
@@ -88,12 +88,12 @@ If using apache, assuming you have the redir script in a /cgi alias
with +execcgi, you can:
RewriteEngine On
- RewriteRule ^/?debian-(security|backports|cd)/(.*) /cgi/redir.pl?mirror=$1&url=$2 [PT]
+ RewriteRule ^/?debian-(security|backports)/(.*) /cgi/redir.pl?mirror=$1&url=$2 [PT]
RewriteRule ^/?debian-archive/(.*) /cgi/redir.pl?mirror=old&url=$1 [PT]
RewriteRule ^/?debian/(.*) /cgi/redir.pl?mirror=archive&url=$1 [PT]
# mirror:// method support:
- RewriteRule ^/?debian-(security|backports|cd)\.list(?:$|\?(.+)) /cgi/redir.pl?mirror=$1.list$2 [QSA,PT]
+ RewriteRule ^/?debian-(security|backports)\.list(?:$|\?(.+)) /cgi/redir.pl?mirror=$1.list$2 [QSA,PT]
RewriteRule ^/?debian-archive\.list(?:$|\?(.+)) /cgi/redir.pl?mirror=old.list$1 [QSA,PT]
RewriteRule ^/?debian\.list(?:$|\?(.+)) /cgi/redir.pl?mirror=archive.list$1 [QSA,PT]
View
8 check.pl
@@ -197,8 +197,6 @@ ($$$)
if ($type eq 'archive') {
$format = 'indices/files/arch-%s.files';
- } elsif ($type eq 'cdimage') {
- $format = 'current/%s/';
} elsif ($type eq 'backports') {
$format = 'dists/stable-backports/main/binary-%s/Release';
} elsif ($type eq 'security') {
@@ -214,7 +212,7 @@ ($$$)
my $url = $base_url;
$url .= sprintf($format, $arch);
- return head_url($url, $type eq 'cdimage');
+ return head_url($url, 0);
}
sub test_source($$) {
@@ -223,8 +221,6 @@ ($$)
if ($type eq 'archive') {
$format = 'dists/sid/main/source/Release';
- } elsif ($type eq 'cdimage') {
- $format = 'current/source/';
} elsif ($type eq 'backports') {
$format = 'dists/stable-backports/main/source/Release';
} elsif ($type eq 'security') {
@@ -236,7 +232,7 @@ ($$)
my $url = $base_url . $format;
- return head_url($url, $type eq 'cdimage');
+ return head_url($url, 0);
}
sub test_areas($$) {
View
1  demo.html
@@ -96,7 +96,6 @@
<option value="/debian/" selected="selected">/debian/</option>
<option value="/debian-backports/">/debian-backports/</option>
<option value="/debian-security/">/debian-security/</option>
-<option value="/debian-cd/">/debian-cd/</option>
<option value="/debian-archive/">/debian-archive/</option>
</select>
<div id="explanation">
View
31 redir.pl
@@ -78,7 +78,6 @@
$add_links = 0;
}
$mirror_type = $q->param('mirror') || 'archive';
-$mirror_type = 'cdimage' if ($mirror_type eq 'cd');
if ($mirror_type =~ s/\.list$//) {
$action = 'list';
@@ -124,28 +123,20 @@
my $url = clean_url($q->param('url') || '');
-my @ARCHITECTURES_REGEX;
-if ($mirror_type eq 'cdimage') {
- @ARCHITECTURES_REGEX = (
- qr'^(?:\d|current)[^/]*/([^/]+)/',
- );
-} else {
- @ARCHITECTURES_REGEX = (
- qr'^dists/(?:[^/]+/){2,3}binary-([^/]+)/',
- qr'^pool/(?:[^/]+/){3,4}.+_([^.]+)\.u?deb$',
- qr'^dists/(?:[^/]+/){1,2}Contents-(?:udeb-(?!nf))?(?!udeb)([^.]+)\.(?:gz$|diff/)',
- qr'^indices/files(?:/components)?/arch-([^.]+).*$',
- qr'^dists/(?:[^/]+/){2}installer-([^/]+)/',
- );
-}
+my @ARCHITECTURES_REGEX = (
+ qr'^dists/(?:[^/]+/){2,3}binary-([^/]+)/',
+ qr'^pool/(?:[^/]+/){3,4}.+_([^.]+)\.u?deb$',
+ qr'^dists/(?:[^/]+/){1,2}Contents-(?:udeb-(?!nf))?(?!udeb)([^.]+)\.(?:gz$|diff/)',
+ qr'^indices/files(?:/components)?/arch-([^.]+).*$',
+ qr'^dists/(?:[^/]+/){2}installer-([^/]+)/',
+);
@archs or @archs = find_arch($url, @ARCHITECTURES_REGEX);
# @archs may only have more than one element iff $action eq 'list'
-# 'all' and 'multi-arch' are not part of the archs that may be passed
-# when running under $action eq 'list', so it should be safe to assume
-# the size of the array
-$archs[0] = 'i386' if ($archs[0] eq 'multi-arch');
-$archs[0] = '' if ($archs[0] eq 'all' || $archs[0] eq 'source');
+# 'all' is not part of the archs that may be passed when running under
+# $action eq 'list', so it should be safe to assume the size of the
+# array
+$archs[0] = '' if ($archs[0] eq 'all');
our $require_ftpsync = ($url =~ m,/InRelease$,);
View
2  update.pl
@@ -39,7 +39,7 @@
my $db_store = 'db';
my @mirror_types = qw(www volatile archive old nonus
backports security cdimage);
-my %exclude_mirror_types = map { $_ => 1 } qw(nonus www volatile);
+my %exclude_mirror_types = map { $_ => 1 } qw(nonus www volatile cdimage);
# Options:
my ($update_list, $threads, $leave_new) = (1, 4, 0);
Please sign in to comment.
Something went wrong with that request. Please try again.