From 109b04314659c0211519a7e140a33d7e662a14cc Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 19 Sep 2005 12:54:28 +0000 Subject: show drakauth (again) in "system" section only if drakwizard isn't installed (#18687) --- control-center | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/control-center b/control-center index 52d8f25f..ba0c2d78 100755 --- a/control-center +++ b/control-center @@ -727,6 +727,12 @@ my %programs = ); + +sub is_wizard_installed { -f top(glob("/usr/lib/perl5/vendor_perl/*/MDK/Wizard/$_[0]")) } + +my $is_auth_wizard_installed = is_wizard_installed('Nisautofs.pm'); + + sub wizard_format { map { my ($id, $wizard, $icon, $description, $long_description, $file, $expert_mode) = @$_; @@ -739,7 +745,7 @@ sub wizard_format { icon => $icon, expert_mode => $expert_mode, }; - -f top(glob("/usr/lib/perl5/vendor_perl/*/MDK/Wizard/$file")) ? $id : (); + is_wizard_installed($file) ? $id : (); } @_; } @@ -811,7 +817,7 @@ my @tree = ], [ N("Authentication"), 'drakauth-mdk', [ - "Authentication", + if_($is_auth_wizard_installed, "Authentication"), (wizard_format(# [ id, wizard file name, icon, description ] [ 'Nis+autofs wizard', "nisautofs", 'nisautofs', N("Configure NIS and Autofs"), N("Configure the NIS and Autofs services"), 'Nisautofs.pm', @@ -903,7 +909,7 @@ my @tree = [ N("System"), 'system-mdk', [ - "Authentication", + if_(!$is_auth_wizard_installed, "Authentication"), "Menus", "Display Manager chooser", "Services", -- cgit v1.2.1