check whether dpkg, apt and others are installed (closes: #18)
This commit is contained in:
parent
0a985948cf
commit
50d8d5edae
1 changed files with 14 additions and 0 deletions
14
mmdebstrap
14
mmdebstrap
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue