diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-26 12:00:43 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-26 12:00:43 +0000 |
commit | 0a77b782bea2371916c3e9efb8f58a60bd7057a7 (patch) | |
tree | cf0badd39b7670a676469e43e7a1d43a8350caa7 /drakwizard.pl | |
parent | 5f71408bd0c50815eb4559444ab3724efdd75f19 (diff) | |
download | drakwizard-0a77b782bea2371916c3e9efb8f58a60bd7057a7.tar drakwizard-0a77b782bea2371916c3e9efb8f58a60bd7057a7.tar.gz drakwizard-0a77b782bea2371916c3e9efb8f58a60bd7057a7.tar.bz2 drakwizard-0a77b782bea2371916c3e9efb8f58a60bd7057a7.tar.xz drakwizard-0a77b782bea2371916c3e9efb8f58a60bd7057a7.zip |
added debug mode and fixed default printing
Diffstat (limited to 'drakwizard.pl')
-rwxr-xr-x | drakwizard.pl | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drakwizard.pl b/drakwizard.pl index 4d001e22..755cc42f 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -19,8 +19,8 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. use lib qw(/usr/lib/libDrakX); -#use strict; -use vars qw($Wizard_title $Wizard_pix_up $lib_script $perl_module %variable $in $rpm $bifield $chooser_hash $welcome); +use strict; +use vars qw($Wizard_title $Wizard_pix_up $lib_script $perl_module %variable $in $rpm %bitfield %chooser_hash $welcome $perl_module_name $verbose); use XML::Parser; use standalone; @@ -54,7 +54,7 @@ if (!defined($ARGV[0])) { 7 => [$prefix."samba_wizard/samba.wiz", "Samba"], 8 => [$prefix."proxy_wizard/proxy.wiz", "Squid"], 9 => [$prefix."time_wizard/time.wiz", "Time"] - ); + ); $in->ask_from( _("Drakwizard wizard selection"), _("Please select a wizard"), @@ -63,15 +63,20 @@ if (!defined($ARGV[0])) { $ARGV[0] = $wiz{$ARGV[0]}[0]; } -if ("@ARGV" =~ /--debug/) { - no warnings; -} - my $o = []; -$xmltree = XML::Parser->new(Style => 'Tree')->parsefile($ARGV[0]); +my $xmltree = XML::Parser->new(Style => 'Tree')->parsefile($ARGV[0]); get_parameter($o, $xmltree); -navigation($o, $o->[0]); +if (("@ARGV" =~ /--debug/)) { + $::verbose = 1; + navigation($o, $o->[0]); +} +else { + no warnings; + $::verbose = 0; + eval { navigation($o, $o->[0]) }; +} + $in->exit; @@ -248,8 +253,8 @@ sub navigation { display($o, $page); my ($next, $prev) = do { if (defined $perl_module_name && $page->{func}) { - @func_arg = split(/\s/, $page->{func}); - $modStatus = $::{$perl_module_name."::"}{"$func_arg[0]"}->(); + my @func_arg = split(/\s/, $page->{func}); + my $modStatus = $::{$perl_module_name."::"}{"$func_arg[0]"}->(); if ($page->{Target}->{jumpIndex}) { find_page($o, $page->{Target}->{jumpIndex}->{int($modStatus)}), $page; } |