debmirror fails on focal because of legacy-images
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debmirror (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
If you use debmirror to mirror the focal repository, and use `--di-dist focal --di-arch=arches`, then the mirroring process fails, because it expects to fetch files from http://
$ /usr/bin/debmirror --host archive.ubuntu.com --method http --rsync-extra=none --diff=none --root ubuntu --keyring /usr/share/
...
/usr/bin/debmirror: Created directory: .temp/d-i/
/usr/bin/debmirror: Created directory: .temp/d-i/dists/
/usr/bin/debmirror: Created directory: .temp/d-
/usr/bin/debmirror: Created directory: .temp/d-
/usr/bin/debmirror: Created directory: .temp/d-
/usr/bin/debmirror: Created directory: .temp/d-
/usr/bin/debmirror: Created directory: .temp/d-
http://
404 Not Found
failed 404 Not Found
Failed to download dists/focal/
Errors:
Download of dists/focal/
Failed to download some Package, Sources or Release files!
WARNING: releasing 1 pending lock...
Also, it is quite annoying that you can't specify `--dist bionic,
description: | updated |
This should patch it:
--- /usr/bin/debmirror 2017-07-22 01:09:37.000000000 +0000 \w(-|\w) */current/ images/ :); \w(-|\w) */current/ [a-z-]* images/ :);
say(" deleting $file") if ($verbose);
$file=~ s:^\./: :; \w(-|\w) */current/ images/ :); \w(-|\w) */current/ [a-z-]* images/ :);
$files{ $file} != -1 && $files{$file} != 2) or
(defined( $ignore) && $file=~/$ignore/o)) {
+++ ./debmirror 2020-05-19 07:49:07.409643328 +0000
@@ -2679,7 +2679,7 @@
if ($use_cache) {
say(": using cache.");
foreach my $file (sort keys %files) {
- next if (@di_dists && $file =~ m:installer-
+ next if (@di_dists && $file =~ m:installer-
if ($files{$file} == 2 && -f $file) {
if (! $do_dry_run) {
@@ -2696,7 +2696,7 @@
foreach my $file (`find . -type f 2>/dev/null`) {
chomp $file;
- next if (@di_dists && $file =~ m:installer-
+ next if (@di_dists && $file =~ m:installer-
unless ((exists $files{$file} &&
@@ -2764,9 +2764,18 @@
my $image_dir = "dists/ $dist/main/ installer- $arch/current/ images" ; $image_ dir"); get("$image_ dir/MD5SUMS" , $tdir)) { $dist/main/ installer- $arch/current/ legacy- images" ; $image_ dir"); get("$image_ dir/MD5SUMS" , $tdir)) { $image_ dir/MD5SUMS" ) {
$bytes_ to_get += -s _; # As we did not have the size earlier \w(-|\w) */current/ images$ :; \w(-|\w) */current/ [a-z-]* images$ :; "$image_ dir") or die "unable to chdir($image_dir): $!\n";
make_dir ("$tdir/
+ my @old_errlog = @errlog;
+ my $old_num_errors = $num_errors;
if (!remote_
- say("Failed to download $image_dir/MD5SUMS; skipping.");
- return;
+ say("Failed to download $image_dir/MD5SUMS; trying legacy-images.");
+ $image_dir = "dists/
+ make_dir ("$tdir/
+ if (!remote_
+ say("Failed to download $image_dir/MD5SUMS; skipping.");
+ return;
+ }
+ @errlog = @old_errlog;
+ $num_errors = $old_num_errors;
}
if (-f "$tdir/
@@ -2841,7 +2850,7 @@
sub di_cleanup {
# Clean up obsolete files
foreach my $image_dir (`find dists/ -type d -name images 2>/dev/null`) {
- next unless $image_dir =~ m:/installer-
+ next unless $image_dir =~ m:/installer-
chomp $image_dir;
chdir(
foreach my $file (`find . -type f 2>/dev/null`) {