]> xenbits.xensource.com Git - osstest.git/commitdiff
Debian mirror: Disable timestamp verification for snapshot.d.o
authorIan Jackson <iwj@xenproject.org>
Tue, 9 Feb 2021 16:05:17 +0000 (16:05 +0000)
committerIan Jackson <iwj@xenproject.org>
Tue, 9 Feb 2021 16:24:52 +0000 (16:24 +0000)
This is kind of duplicative of the logic in preseed_backports_packages
but I don't want to mess with that now.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
Osstest.pm
Osstest/Debian.pm

index 809194f0dc2e3be00a4b074f5ba78d06357a6f35..7776ba88c6e2b9996758c999fc158cdfef5a404b 100644 (file)
@@ -246,6 +246,8 @@ sub readglobalconfig () {
     $c{DefaultBranch} ||= 'xen-unstable';
 
     $c{DebianMirrorHost} ||= 'ftp.debian.org' if $c{DebianMirrorProxy};
+    $c{DebianMirrorAllowExpiredReleaseRegexp} //=
+      qr{^\Qhttp://snapshot.debian.org/};
 
     $c{EmailStdHeaders} ||= <<'END';
 Content-Type: text/plain; charset="UTF-8"
index dee52b3d05912c365641828f2bfe0c2b15a75206..d6e0b59db12e3540271f34918638cd0ef12f3c2f 100644 (file)
@@ -972,6 +972,22 @@ END
     preseed_hook_command($ho, 'late_command', $sfx,
                         debian_dhcp_rofs_fix($ho, '/target'));
 
+    my $murl = debian_mirror_url($ho);
+    if ($murl =~ m/$c{DebianMirrorAllowExpiredReleaseRegexp}/) {
+       # Inspired by
+       #  https://stackoverflow.com/questions/25039317/is-there-any-setting-in-the-preseed-file-to-ignore-the-release-valid-until-opt/51396935#51396935
+       # In some sense a workaround for the lack of a better way,
+       #  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771699
+       preseed_hook_installscript($ho, $sfx,
+            '/usr/lib/apt-setup/generators/', '02IgnoreValidUntil', <<'END');
+#!/bin/sh
+set -ex
+d=/target/etc/apt/apt.conf.d/
+mkdir -p $d
+echo 'Acquire::Check-Valid-Until "false";' >$d/02IgnoreValidUntil
+END
+    }
+
     my ($mhost, $mpath) = debian_mirror_host_path($ho);
 
     my $preseed = <<"END";