summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdrakwizard.pl27
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;
}