check whether dpkg, apt and others are installed (closes: #18)

This commit is contained in:
Johannes 'josch' Schauer 2020-11-12 22:36:10 +01:00
parent 0a985948cf
commit 50d8d5edae
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -3953,6 +3953,20 @@ sub main() {
error "invalid format. Choose from " . (join ', ', @valid_formats);
}
foreach my $tool ('dpkg', 'dpkg-deb', 'apt-get', 'apt-cache', 'apt-config',
'tar') {
my $found = 0;
foreach my $path (split /:/, $ENV{PATH}) {
if (-f "$path/$tool" && -x _ ) {
$found = 1;
last;
}
}
if (!$found) {
error "cannot find $tool";
}
}
my $check_fakechroot_running = sub {
# test if we are inside fakechroot already
# We fork a child process because setting FAKECHROOT_DETECT seems to