mmdebstrap: Show APT's dependency trace when in debug mode

A dependency trace is a powerful tool to debug issues related to
APT's selection of packages, especially in custom mode.

Thus it makes sense to ask APT to output a dependency trace when
`mmdebstrap` is run with the `--debug` flag.
This commit is contained in:
Gioele Barabucci 2022-08-20 17:05:11 +02:00 committed by Johannes Schauer Marin Rodrigues
parent 7d7d757f00
commit 7ce6db0ca7
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -962,6 +962,16 @@ sub run_apt_download_progress {
} else {
info "downloading packages with apt...";
}
if ($verbosity_level >= 3) {
my @apt_debug_opts = qw(
-oDebug::pkgProblemResolver=true
-oDebug::pkgDepCache::Marker=1
-oDebug::pkgDepCache::AutoInstall=1
);
push @{ $options->{APT_ARGV} }, @apt_debug_opts;
}
pipe my $rfh, my $wfh;
my $pid = open my $fh, '-|' // error "fork() failed: $!";
if ($pid == 0) {