summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-10-18 12:14:04 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-10-18 12:14:04 +0000
commit129ffedff2129b60c07dc8d548531e26aee01968 (patch)
tree7556baeb295ff2cce02373ae9d472a77b377be7b /perl-install/standalone
parentd8bd03467d4f4e3bf73c86e0aaeb7775d0380788 (diff)
downloaddrakx-129ffedff2129b60c07dc8d548531e26aee01968.tar
drakx-129ffedff2129b60c07dc8d548531e26aee01968.tar.gz
drakx-129ffedff2129b60c07dc8d548531e26aee01968.tar.bz2
drakx-129ffedff2129b60c07dc8d548531e26aee01968.tar.xz
drakx-129ffedff2129b60c07dc8d548531e26aee01968.zip
Club integration for proprietary drivers: offer to subscribe to Mandriva Club
if some proprietary packages are needed and are not availlable, thus allowing automatic download/installation of proprietary drivers from Club
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/harddrake241
1 files changed, 40 insertions, 1 deletions
diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2
index b9957cc68..9f52c2e15 100755
--- a/perl-install/standalone/harddrake2
+++ b/perl-install/standalone/harddrake2
@@ -235,6 +235,7 @@ $ugtk2::wm_icon = "harddrake";
$in = 'interactive'->vnew('su'); #require_root_capability();
%options = getVarsFromSh($conffile);
+$options{MDV_ONLINE} ||= [];
# Build the gui
add_icon_path('/usr/share/pixmaps/harddrake2/');
@@ -243,6 +244,25 @@ $w = ugtk2->new(N("Harddrake2"));
# fake diagnostics pragma:
local $::main_window = $w->{real_window};
+require list_modules;
+my @proprietary_drivers = (qw(avmfritz fcpci fcdsl fcdsl fcdsl2 fcdslsl fcdslslusb fcdslusb fcdslusba fcusb fcusb2 fxusb fxusb_CZ), #ISDN
+ qw(slamr slusb), # SLAMR
+ qw(ltmodem speedtch), # modem
+ qw(speedtch), # ADSL
+ qw(a320raid), # block
+ qw(ath_pci ipw2100 ipw2200 prism54 speedtch), # network
+ list_modules::category2modules('network/slmodem'),
+ );
+
+sub need_pkgs_offered_by_club {
+ my ($device) = @_;
+
+ # need firmware, 3rd party driver or 3rd party program:
+ $device->{description} =~ /HostRAID/ ||
+ $device->{driver} =~ /^at76|^LT:|^Hcf:|^Hsf:/ ||
+ member($device->{driver}, @proprietary_drivers);
+}
+
my ($menubar, $factory) = create_factory_menu($w->{real_window}, @menu_items);
$w->{window}->set_size_request(805, 550) if !$::isEmbedded;
@@ -388,6 +408,10 @@ foreach (@classes) {
# Fill the graphic tree with a "tree leaf" widget per device
foreach (@devices) {
+ if ($options{MDV_ONLINE} ne 'done' && ref $options{MDV_ONLINE}) {
+ push @{$options{MDV_ONLINE}}, $_ if $_->{need_pkgs_offered_by_club} ||= need_pkgs_offered_by_club($_);
+ }
+
# we really should test for $title there:
if ($_->{bus} && $_->{bus} eq "PCI") {
# do not display unknown driver for system bridges that're managed by kernel core:
@@ -479,10 +503,25 @@ $textcolumn->set_sizing('GTK_TREE_VIEW_COLUMN_AUTOSIZE');#GROW_ONLY
$tree->signal_connect(realize => sub { $tree->get_selection->select_path(Gtk2::TreePath->new_first) });
{
+ my $do_pkgs;
$SIG{CHLD} = undef;
#local $SIG{CHLD} = sub {};
+
+ if (ref $options{MDV_ONLINE} && @{$options{MDV_ONLINE}}) { # was the question already answered?
+ $do_pkgs ||= do_pkgs_standalone->new;
+ if (!$do_pkgs->is_available('speedtouch_mgmt') # do we have access to 3rd party programs?
+ && $in->ask_yesorno(N("Warning"),
+ N("The following devices needs proprietary drivers or firmwares in order to operate smoothly. The appropriate packages can be retrieved from the Mandriva Club. Do you want to subscribe to the Mandriva Club?") . "\n\n" .
+ join(",\n", map { print "- $_->{description}\n"; "- " . $_->{description} } @{$options{MDV_ONLINE}}))) {
+ $do_pkgs->install('mdkonline') if !-x '/usr/X11R6/bin/mdkonline';
+ require run_program;
+ run_program::raw({ detach => 1 }, "/usr/X11R6/bin/mdkonline");
+ }
+ }
+ $options{MDV_ONLINE} = 'done';
+
if (my @packages = difference2([ simple_read_rpmsrate() ], [ qw(ati.2 dmraid gnome-alsamixer mdadm xmms-alsa) ])) {
- my $do_pkgs = do_pkgs_standalone->new;
+ $do_pkgs ||= do_pkgs_standalone->new;
my @packages2install = grep { $do_pkgs->is_available($_) && !$do_pkgs->is_installed($_) } @packages;
undef $wait;
gtkset_mousecursor_normal();