diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-02 16:32:37 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-02 16:32:37 +0000 |
commit | e9c08fc4ca5fa4e3b26dc032c12263a29c662bce (patch) | |
tree | c8a27c76fc3d5dc6e233494c5e214900b2beef65 | |
parent | 6260bd91d3e801bf5392227e369c29429b3fc5e4 (diff) | |
download | drakwizard-e9c08fc4ca5fa4e3b26dc032c12263a29c662bce.tar drakwizard-e9c08fc4ca5fa4e3b26dc032c12263a29c662bce.tar.gz drakwizard-e9c08fc4ca5fa4e3b26dc032c12263a29c662bce.tar.bz2 drakwizard-e9c08fc4ca5fa4e3b26dc032c12263a29c662bce.tar.xz drakwizard-e9c08fc4ca5fa4e3b26dc032c12263a29c662bce.zip |
add asking for package concerned by the wizard (see rpm section in the xml) and install if desired
-rwxr-xr-x | drakwizard.pl | 11 |
1 files changed, 9 insertions, 2 deletions
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}; |