diff options
Diffstat (limited to 'debmirror')
-rwxr-xr-x | debmirror | 63 |
1 files changed, 42 insertions, 21 deletions
@@ -1103,12 +1103,21 @@ if ($getcontents) { 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"); + # In Debian Wheezy, the Contents-*.gz moved to '/dists/$dist/$sect/'. + # This handles the new location, but also checks the old location + # for backwards compatibility. + push my @sects, @sections, ""; + foreach my $sect (@sects) { + if ($sect ne "") {$sect = "/$sect";} + if (exists $file_lists{"$tempdir/dists/$dist${sect}Contents-$arch.gz"}) { + 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"); + } + } } } } @@ -1961,10 +1970,16 @@ sub link_release_into_snapshot { 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"; + push my @sects, @sections, ""; + foreach my $sect (@sects) { + if ($sect ne "") {$sect = "/$sect";} + if (exists $file_lists{"$tempdir/dists/$dist$sect/Contents-$arch.gz"}) { + 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"; + } + } } sub link_translation_into_snapshot { @@ -2312,17 +2327,23 @@ sub get_contents_files { 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); + push my @sects, @sections, ""; + foreach my $sect (@sects) { + if ($sect ne "") {$sect = "/$sect";} + if (exists $file_lists{"$tempdir/dists/$dist$sect/Contents-$arch.gz"}) { + 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); + } + } } } } |