use DPkg::Path as default value for PATH

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-05-24 20:35:25 +02:00
parent 27926c75f9
commit c6c9c27969
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -4353,12 +4353,13 @@ sub main() {
}
# setting PATH for chroot, ldconfig, start-stop-daemon...
my $defaultpath = `eval \$(apt-config shell v DPkg::Path); printf \$v`;
if (length $ENV{PATH}) {
## no critic (Variables::RequireLocalizedPunctuationVars)
$ENV{PATH} = "$ENV{PATH}:/usr/sbin:/usr/bin:/sbin:/bin";
$ENV{PATH} = "$ENV{PATH}:$defaultpath";
} else {
## no critic (Variables::RequireLocalizedPunctuationVars)
$ENV{PATH} = "/usr/sbin:/usr/bin:/sbin:/bin";
$ENV{PATH} = $defaultpath;
}
foreach my $tool (