Fix to use a new API to preserve existing config options (when hidden)

This commit is contained in:
iliajie
2022-07-30 01:03:22 +03:00
parent e620256af4
commit 1bb7128ef2

View File

@@ -263,17 +263,27 @@ return &has_command("hwclock") &&
!&running_in_openvz() && !&running_in_zone();
}
# config_preserve()
# Returns a list of config options that
# cannot be shown on the given system
sub config_preserve
{
my @forbidden_keys;
# Do not display timeformat for Linux systems
push(@forbidden_keys, 'seconds')
if ($gconfig{'os_type'} =~ /linux$/);
return @forbidden_keys;
}
# config_pre_load(mod-info-ref, [mod-order-ref])
# Check if some config options are conditional,
# and if not allowed, remove them from listing
sub config_pre_load
{
my ($modconf_info, $modconf_order) = @_;
my @forbidden_keys;
# Do not display timeformat for Linux systems
push(@forbidden_keys, 'seconds')
if ($gconfig{'os_type'} =~ /linux$/);
my @forbidden_keys = &config_preserve();
# Remove forbidden from display
foreach my $fkey (@forbidden_keys) {