  
      unless ( open STREAM, "<$release_path" )
      {
-@@ -777,6 +777,7 @@ sub process_index
+@@ -779,8 +779,10 @@ sub process_index
      my ( $path, $package, $mirror, $files ) = '';
  
      $path = sanitise_uri($uri);
-+    $path =~ s&^[^/]+/&&;
++    $path =~ s&^[^/]+/?&&;
      local $/ = "\n\n";
      $mirror = get_variable("mirror_path") . "/" . $path;
++    $path = $mirror;
  
-@@ -853,12 +854,12 @@ foreach (@config_sources)
+     if (-e "$path/$index.gz" )
+     {
+@@ -857,12 +859,12 @@ foreach (@config_sources)
          my $component;
          foreach $component (@components)
          {

     }
 }
 
@@ -871,12 +872,12 @@ foreach (@config_binaries)
         my $component;
         foreach $component (@components)
         {

     }
 }
 
@@ -936,10 +938,10 @@ sub copy_file
 foreach (@index_urls)
 {
     die("apt-mirror: invalid url in index_urls") unless s[^(\w+)://][];
