diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2005-03-22 16:39:00 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2005-03-22 16:39:00 +0000 |
commit | 6423d696699210ebf207d057e24a1cea9678357d (patch) | |
tree | a97a1802ba635d4a3944ce248208c168bef71288 /perl-install/standalone/harddrake2 | |
parent | acddb352ae4cf5d0d93449843f29ebd61f530809 (diff) | |
download | drakx-backup-do-not-use-6423d696699210ebf207d057e24a1cea9678357d.tar drakx-backup-do-not-use-6423d696699210ebf207d057e24a1cea9678357d.tar.gz drakx-backup-do-not-use-6423d696699210ebf207d057e24a1cea9678357d.tar.bz2 drakx-backup-do-not-use-6423d696699210ebf207d057e24a1cea9678357d.tar.xz drakx-backup-do-not-use-6423d696699210ebf207d057e24a1cea9678357d.zip |
install packages needed for hw support
Diffstat (limited to 'perl-install/standalone/harddrake2')
-rwxr-xr-x | perl-install/standalone/harddrake2 | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index 4512f42ea..9a992f110 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -5,6 +5,7 @@ use diagnostics; use lib qw(/usr/lib/libDrakX); use standalone; use common; +use do_pkgs; # i18n: IMPORTANT: to get correct namespace (drakconf instead of only libDrakX) BEGIN { unshift @::textdomains, 'drakconf' } @@ -463,9 +464,26 @@ $textcolumn->set_sizing('GTK_TREE_VIEW_COLUMN_AUTOSIZE');#GROW_ONLY #$tree->columns_autosize(); $tree->signal_connect(realize => sub { $tree->get_selection->select_path(Gtk2::TreePath->new_first) }); $w->{rwindow}->show_all; +$_->hide foreach $module_cfg_button, $config_button; # hide buttons while no device + +{ + $SIG{CHLD} = undef; + #local $SIG{CHLD} = sub {}; + if (my @packages = simple_read_rpmsrate()) { + my $do_pkgs = do_pkgs_standalone->new; + my @packages2install = grep { !$do_pkgs->is_installed($_) } @packages; + undef $wait; + gtkset_mousecursor_normal(); + + if (@packages2install && $in->ask_yesorno(N("Warning"), N("The following packages need to be installed:\n" . join(', ', @packages2install)))) { + $do_pkgs->install(@packages2install); + } + } +} undef $wait; gtkset_mousecursor_normal(); -$_->hide foreach $module_cfg_button, $config_button; # hide buttons while no device + + $w->main; @@ -560,3 +578,16 @@ $password_w->set_visibility(0); #set_invisible_char('*'); run_program::raw({ detach => 1 }, "/usr/sbin/hwdb_add_system", $account, $name); } } + + +sub simple_read_rpmsrate { + map { split(' ', $_) } map { + if (my ($p, $packages) = /[^!]HW"(.*)"(.*)/) { + if_(detect_devices::matching_desc__regexp($p), $packages); + } elsif (($p, $packages) = /[^!]DRIVER"(.*)"(.*)/) { + if_(detect_devices::matching_driver__regexp($p), $packages); + } else { + (); + } + } cat_("/usr/share/harddrake/rpmsrate"); +} |