set PATH if it's unset or empty

This commit is contained in:
Johannes 'josch' Schauer 2021-01-06 11:49:29 +01:00
parent 8c42daad92
commit 9484107392
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -4312,6 +4312,11 @@ sub main() {
error "invalid format. Choose from " . (join ', ', @valid_formats); error "invalid format. Choose from " . (join ', ', @valid_formats);
} }
if (!defined $ENV{PATH} || $ENV{PATH} eq "") {
## no critic (Variables::RequireLocalizedPunctuationVars)
$ENV{PATH} = "/usr/sbin:/usr/bin:/sbin:/bin";
}
foreach my $tool ('dpkg', 'dpkg-deb', 'apt-get', 'apt-cache', 'apt-config', foreach my $tool ('dpkg', 'dpkg-deb', 'apt-get', 'apt-cache', 'apt-config',
'tar') { 'tar') {
my $found = 0; my $found = 0;