From 1bb7128ef2f9ab954a4f21cb718bdefe695221e3 Mon Sep 17 00:00:00 2001 From: iliajie Date: Sat, 30 Jul 2022 01:03:22 +0300 Subject: [PATCH] Fix to use a new API to preserve existing config options (when hidden) --- time/time-lib.pl | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/time/time-lib.pl b/time/time-lib.pl index 0e66ba431..bd75a18a5 100755 --- a/time/time-lib.pl +++ b/time/time-lib.pl @@ -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) {