Hello,

me and two colleagues developed a small patch which we believe solves the
bug. We used the patched debmirror version for mirroring squeeze, wheezy,
jessie and sid, and like we expected, it used the old location for squeeze
contents files and the new location for wheezy, jessie and sid contents
files.

I have attached the patch; it should at least apply to newest debmirror
version: 1:2.15

Regards
  Christoph
--- debmirror.sid	2013-06-14 13:36:04.000000000 +0200
+++ debmirror_modified_sid	2013-06-14 13:43:38.000000000 +0200
@@ -1104,12 +1104,26 @@
       next if $dist=~/experimental/;
       next if $dist=~/.*-proposed-updates/;
       next if $arch=~/source/;
-      if ($diff_mode ne "none") {
-	if (!update_contents("dists/$dist", "Contents-$arch")) {
-	  add_bytes("dists/$dist/Contents-$arch.gz");
-	}
-      } elsif (!check_lists("$tempdir/dists/$dist/Contents-$arch.gz")) {
-	add_bytes("dists/$dist/Contents-$arch.gz");
+#EDIT: sect-stuff
+      if ($dist=~/^wheezy|^sid|^jessie/) {
+        foreach my $sect (@sections) {
+          if ($diff_mode ne "none") {
+	    if (!update_contents("dists/$dist/$sect", "Contents-$arch")) {
+	      add_bytes("dists/$dist/$sect/Contents-$arch.gz");
+	    }
+          } elsif (!check_lists("$tempdir/dists/$dist/$sect/Contents-$arch.gz")) {
+	    add_bytes("dists/$dist/$sect/Contents-$arch.gz");
+          }
+        }
+      } else {
+#END_EDIT
+        if ($diff_mode ne "none") {
+	  if (!update_contents("dists/$dist", "Contents-$arch")) {
+	    add_bytes("dists/$dist/Contents-$arch.gz");
+	  }
+        } elsif (!check_lists("$tempdir/dists/$dist/Contents-$arch.gz")) {
+  	  add_bytes("dists/$dist/Contents-$arch.gz");
+        }
       }
     }
   }
@@ -1962,10 +1976,21 @@
 sub link_contents_into_snapshot {
   my ($dist,$mirrordir,$arch,$tempdir) = @_;
   my $next = get_next_snapshot($dist);
-  unlink("$mirrordir/dists/$dist/$next/Contents-$arch.gz");
-  link("$tempdir/dists/$dist/Contents-$arch.gz",
-       "$mirrordir/dists/$dist/$next/Contents-$arch.gz")
-    or die "Error while linking $tempdir/dists/$dist/Contents-$arch.gz: $!\n";
+#EDIT: sect-stuff, not tested
+  if ($dist=~/^wheezy|^sid|^jessie/) {
+    foreach my $sect (@sections) {
+      unlink("$mirrordir/dists/$dist/$next/$sect/Contents-$arch.gz");
+      link("$tempdir/dists/$dist/$sect/Contents-$arch.gz",
+           "$mirrordir/dists/$dist/$next/$sect/Contents-$arch.gz")
+        or die "Error while linking $tempdir/dists/$dist/$sect/Contents-$arch.gz: $!\n";
+    }
+  } else {
+#END_EDIT
+      unlink("$mirrordir/dists/$dist/$next/Contents-$arch.gz");
+      link("$tempdir/dists/$dist/Contents-$arch.gz",
+           "$mirrordir/dists/$dist/$next/Contents-$arch.gz")
+        or die "Error while linking $tempdir/dists/$dist/Contents-$arch.gz: $!\n";
+  }
 }
 
 sub link_translation_into_snapshot {
@@ -2313,17 +2338,36 @@
       next if $dist=~/experimental/;
       next if $dist=~/.*-proposed-updates/;
       next if $arch=~/source/;
-      if (!check_lists("$tempdir/dists/$dist/Contents-$arch.gz")) {
-	if ($first) {
-	  say("Get Contents files.");
-	  $first = 0;
-	}
-	remote_get("dists/$dist/Contents-$arch.gz");
-      }
-      $files{"dists/$dist/Contents-$arch.gz"}=1;
-      $files{$tempdir."/"."dists/$dist/Contents-$arch.gz"}=1;
-      if ($debmarshal) {
-	link_contents_into_snapshot($dist,$mirrordir,$arch,$tempdir);
+#EDIT: sect-stuff
+      if ($dist=~/^wheezy|^sid|^jessie/) {
+	foreach my $sect (@sections) {
+	  if (!check_lists("$tempdir/dists/$dist/$sect/Contents-$arch.gz")) {
+          if ($first) {
+            say("Get Contents files.");
+            $first = 0;
+          }
+          remote_get("dists/$dist/$sect/Contents-$arch.gz");
+      	  }
+      	  $files{"dists/$dist/$sect/Contents-$arch.gz"}=1;
+      	  $files{$tempdir."/"."dists/$dist/$sect/Contents-$arch.gz"}=1;
+      	  if ($debmarshal) {
+       	   link_contents_into_snapshot($dist,$mirrordir,$arch,$tempdir);
+      	  }
+        }
+      } else {
+#END_EDIT
+	if (!check_lists("$tempdir/dists/$dist/Contents-$arch.gz")) {
+	  if ($first) {
+	    say("Get Contents files.");
+	    $first = 0;
+	  }
+	  remote_get("dists/$dist/Contents-$arch.gz");
+        }
+        $files{"dists/$dist/Contents-$arch.gz"}=1;
+        $files{$tempdir."/"."dists/$dist/Contents-$arch.gz"}=1;
+        if ($debmarshal) {
+ 	  link_contents_into_snapshot($dist,$mirrordir,$arch,$tempdir);
+        }
       }
     }
   }

Reply via email to