set APT::Immediate-Configure to false in dry-run mode

This commit is contained in:
Johannes 'josch' Schauer 2020-03-07 02:12:21 +01:00
parent 3e50d09b43
commit 1ff5ba7e9e
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1224,6 +1224,14 @@ sub setup {
# options.
print $conf "pkgCacheGen::ForceEssential \",\";\n";
}
if ($options->{dryrun}) {
# Without this option, apt will fail with:
# E: Could not configure 'libc6:amd64'.
# E: Could not perform immediate configuration on 'libgcc1:amd64'.
#
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953260
print $conf "APT::Immediate-Configure false;\n";
}
close $conf;
{
@ -2851,6 +2859,15 @@ sub main() {
'setup-hook=s@' => \$options->{setup_hook},
'essential-hook=s@' => \$options->{essential_hook},
'customize-hook=s@' => \$options->{customize_hook},
# Sometimes --simulate fails even though non-simulate succeeds because
# in simulate mode, apt cannot rely on dpkg to figure out tricky
# dependency situations and will give up instead when it cannot find
# a solution.
#
# 2020-02-06, #debian-apt on OFTC, times in UTC+1
# 12:52 < DonKult> [...] It works in non-simulation because simulate is
# more picky. If you wanna know why simulate complains
# here prepare for long suffering in dependency hell.
'simulate' => \$options->{dryrun},
'dry-run' => \$options->{dryrun},
) or pod2usage(-exitval => 2, -verbose => 1);