diff options
Diffstat (limited to 'lib/Sbuild/Conf.pm')
-rw-r--r-- | lib/Sbuild/Conf.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm index d0e3f6f..ffe56d1 100644 --- a/lib/Sbuild/Conf.pm +++ b/lib/Sbuild/Conf.pm @@ -249,16 +249,18 @@ sub setup ($) { }, 'SCHROOT' => { TYPE => 'STRING', - GROUP => '__INTERNAL', + VARNAME => 'schroot', + GROUP => 'Programs', CHECK => sub { my $conf = shift; my $entry = shift; my $key = $entry->{'NAME'}; # Only validate if needed. - if ($conf->get('CHROOT_MODE') eq 'schroot') { - $validate_program->($conf, $entry); - } + if (defined $conf->_get('CHROOT_MODE') + && $conf->_get('CHROOT_MODE') eq 'schroot') { + $validate_program->($conf, $entry); + } }, DEFAULT => 'schroot', HELP => 'Path to schroot binary' @@ -734,7 +736,13 @@ sub setup ($) { if !isin($conf->get('CHROOT_MODE'), qw(schroot sudo autopkgtest unshare)); }, - DEFAULT => 'schroot', + DEFAULT => undef, + GET => sub { + my $conf = shift; + my $entry = shift; + + return ($conf->_get($entry->{'NAME'}) // 'schroot'); + }, HELP => 'Mechanism to use for chroot virtualisation. Possible value are "schroot" (default), "sudo", "autopkgtest" and "unshare".', CLI_OPTIONS => ['--chroot-mode'] }, |