forked from josch/mmdebstrap
store valid modes in an array
This commit is contained in:
parent
550562cf6f
commit
0cdd803ba0
1 changed files with 3 additions and 4 deletions
|
@ -988,10 +988,9 @@ sub main() {
|
||||||
if ($options->{mode} eq 'sudo') {
|
if ($options->{mode} eq 'sudo') {
|
||||||
$options->{mode} = 'root';
|
$options->{mode} = 'root';
|
||||||
}
|
}
|
||||||
if ($options->{mode} ne 'auto' and $options->{mode} ne 'root'
|
my @valid_modes = ('auto', 'root', 'unshare', 'fakechroot', 'proot');
|
||||||
and $options->{mode} ne 'fakechroot'
|
if (!grep { $_ eq $options->{mode} } @valid_modes) {
|
||||||
and $options->{mode} ne 'proot' and $options->{mode} ne 'unshare') {
|
die "invalid mode. Choose from " . (join ', ', @valid_modes);
|
||||||
die "invalid mode. Choose from auto, root, fakechroot, proot, unshare";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($options->{variant} eq 'essential' and defined $options->{include}) {
|
if ($options->{variant} eq 'essential' and defined $options->{include}) {
|
||||||
|
|
Loading…
Reference in a new issue