From e9c08fc4ca5fa4e3b26dc032c12263a29c662bce Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Fri, 2 Aug 2002 16:32:37 +0000 Subject: add asking for package concerned by the wizard (see rpm section in the xml) and install if desired --- drakwizard.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drakwizard.pl') diff --git a/drakwizard.pl b/drakwizard.pl index 7ddcdeb1..e9731338 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -20,7 +20,7 @@ use lib qw(/usr/lib/libDrakX); #use strict; -use vars qw($wizard_title $lib_script $perl_module %variable $in $welcome); +use vars qw($wizard_title $lib_script $perl_module %variable $in $welcome $rpm); use XML::Parser; use standalone; @@ -45,13 +45,20 @@ sub get_parameter { my $common_freetext_chooser; my %actions = ( Wizard => sub { - ($wizard_title, $lib_script, $perl_module) = @{$leaf}{qw(wizardTitle libScript perlModule)}; + ($wizard_title, $lib_script, $perl_module, $rpm) = @{$leaf}{qw(wizardTitle libScript perlModule rpm)}; if ($perl_module) { require $perl_module; } if ($perl_module =~ /.*\/(.*)\.pm/) { $::perl_module_name = $1; } + if ($rpm) { + if (!$in->do_pkgs->is_installed($rpm)) { + $in->ask_okcancel("error", "$rpm is not installed\nClick ok to add it or cancel to exit") and + $in->do_pkgs->install($rpm) or + $in->exit; + } + } }, Variable => sub { $variable{$leaf->{name}} = $leaf->{shellVariable}; -- cgit v1.2.1