place DPkg::Pre-Install-Pkgs workaround into a new config file

Using APT_CONFIG will render the setting ineffective.

Debian-Bug: #1091442
This commit is contained in:
Johannes Schauer Marin Rodrigues 2025-01-11 09:11:01 +01:00
parent dc5bbb7173
commit 917a879c4b
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -3108,7 +3108,11 @@ sub run_setup() {
# dpkg-preconfigure should not be needed as we also have set
# DEBIAN_FRONTEND=noninteractive and DEBCONF_NONINTERACTIVE_SEEN=true and
# should thus never see debconf prompts. See #1091442 for details.
print $conf "#clear DPkg::Pre-Install-Pkgs;\n";
{
open my $tmp, '>', "$options->{root}/etc/apt/apt.conf.d/99debconf"
or error "cannot open /etc/apt/apt.conf.d/99debconf: $!";
print $tmp "#clear DPkg::Pre-Install-Pkgs;\n";
}
close $conf;
@ -4164,6 +4168,8 @@ sub run_cleanup() {
# clean up temporary configuration file
unlink "$options->{root}/etc/apt/apt.conf.d/00mmdebstrap"
or warning "failed to unlink /etc/apt/apt.conf.d/00mmdebstrap: $!";
unlink "$options->{root}/etc/apt/apt.conf.d/99debconf"
or warning "failed to unlink /etc/apt/apt.conf.d/99debconf: $!";
if (defined $ENV{APT_CONFIG} && -e $ENV{APT_CONFIG}) {
unlink $ENV{APT_CONFIG}