diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-14 12:06:28 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2002-11-14 12:06:28 +0000 |
commit | 3b98e33d8512b56cc2b4e1ba779ff71bc93ca5de (patch) | |
tree | c0008ba79ad86beb0fec8cc6dbaba142e3184ff4 /drakxconf | |
parent | bb0cb26ce23ad0afefd44856c95ef8f83fcc201b (diff) | |
download | control-center-3b98e33d8512b56cc2b4e1ba779ff71bc93ca5de.tar control-center-3b98e33d8512b56cc2b4e1ba779ff71bc93ca5de.tar.gz control-center-3b98e33d8512b56cc2b4e1ba779ff71bc93ca5de.tar.bz2 control-center-3b98e33d8512b56cc2b4e1ba779ff71bc93ca5de.tar.xz control-center-3b98e33d8512b56cc2b4e1ba779ff71bc93ca5de.zip |
- fixes for strict mode
- prevent perl to parse cvs id as a variable
- fix formatting sub that returned nothing
- fix "let's execute something other than we get"
- fixes for latest libDrakx changes
- prevent importing useless modules
Diffstat (limited to 'drakxconf')
-rwxr-xr-x | drakxconf | 61 |
1 files changed, 27 insertions, 34 deletions
@@ -1,50 +1,43 @@ #!/usr/bin/perl use lib qw(/usr/lib/libDrakX); +use strict; use standalone; #- warning, standalone must be loaded very first, for 'explanations' - use interactive; -use keyboard; use common; -use c; local $_ = join '', @ARGV; /-h/ and die "usage: drakxconf\n"; -/-version/ and die "version: $Id$\n"; +/-version/ and die 'version: $Id$\n'; my $in = 'interactive'->vnew('su', 'default'); -my @l=( - { des => _("Display Configuration"), - cmd => 'XFdrake'}, - { des => _("KeyBoard Configuration"), - cmd => 'keyboarddrake'}, - { des => _("Mouse Configuration"), - cmd => 'mousedrake'}, - { des => _("Internet & Network"), - cmd => 'drakconnect'}, - { des => _("Printer Configuration"), - cmd => 'printerdrake'}, - { des => _("Add new users"), - cmd => 'adduserdrake'}, - { des => _("Service Configuration"), - cmd => 'drakxservices'}, - { des => _("Firewall"), - cmd => 'tinyfirewall'}, - { des => _("Boot Configuration"), - cmd => 'drakboot'}, - { des => _("Auto Install"), - cmd => 'drakautoinst'}, - { des => _("Connection Sharing"), - cmd => 'drakgw'}, - { des => _("Disk Partionning"), - cmd => 'diskdrake'}, - ); -my $choice = $in->ask_from_listf(_("Control Center"), - _("Choose the tool you want to use"), - sub { (int grep { -x "$_/" . $_[0]{cmd} } split (":", $ENV{PATH})) ? $_[0]{des} : () }, - \@l ) or $in->exit(1); + +my @l = map { + my $path; + foreach my $i (split (":", $ENV{PATH})) { + my $j = "$i/$_->{cmd}"; + $path = $j if -x $j; + } + { des => $_->{des}, cmd => $path }; +} ( + { des => N("Display Configuration"), cmd => 'XFdrake'}, + { des => N("KeyBoard Configuration"), cmd => 'keyboarddrake'}, + { des => N("Mouse Configuration"), cmd => 'mousedrake'}, + { des => N("Internet & Network"), cmd => 'drakconnect'}, + { des => N("Printer Configuration"), cmd => 'printerdrake'}, + { des => N("Add new users"), cmd => 'adduserdrake'}, + { des => N("Service Configuration"), cmd => 'drakxservices'}, + { des => N("Firewall"), cmd => 'tinyfirewall'}, + { des => N("Boot Configuration"), cmd => 'drakboot'}, + { des => N("Auto Install"), cmd => 'drakautoinst'}, + { des => N("Connection Sharing"), cmd => 'drakgw'}, + { des => N("Disk Partionning"), cmd => 'diskdrake'} + ); + +my $choice = $in->ask_from_listf(N("Control Center"), N("Choose the tool you want to use"), sub { $_[0]{des} }, \@l ) + or $in->exit(1); $in->end; exec $choice->{cmd}, @ARGV or $in->exit(1); |