In jessie and earlier, this has to be done with a global option.
In later releases, it can be done by putting some options in [ ]
in the relevant sources list entry.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
my $apt_insert='';
my $extra_rune='';
+ if ($suite =~ m/wheezy|jessie/) {
+ # this has global effect, unfortunately
+ $extra_rune = <<END;
+d=/etc/apt/apt.conf.d
+mkdir -p \$d
+cat >\$d/50osstestsnapshot <<EOF
+Acquire::Check-Valid-Until false;
+EOF
+END
+ } else {
+ $apt_insert = '[check-valid-until=no]';
+ }
+
preseed_hook_command($ho, 'late_command', $sfx, <<END);
#!/bin/sh
set -ex