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 untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1224,6 +1224,14 @@ sub setup {
# options. # options.
print $conf "pkgCacheGen::ForceEssential \",\";\n"; 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; close $conf;
{ {
@ -2851,8 +2859,17 @@ sub main() {
'setup-hook=s@' => \$options->{setup_hook}, 'setup-hook=s@' => \$options->{setup_hook},
'essential-hook=s@' => \$options->{essential_hook}, 'essential-hook=s@' => \$options->{essential_hook},
'customize-hook=s@' => \$options->{customize_hook}, 'customize-hook=s@' => \$options->{customize_hook},
'simulate' => \$options->{dryrun}, # Sometimes --simulate fails even though non-simulate succeeds because
'dry-run' => \$options->{dryrun}, # 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); ) or pod2usage(-exitval => 2, -verbose => 1);
if (defined($logfile)) { if (defined($logfile)) {