summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-30 14:44:12 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-30 14:44:12 +0000
commit7e2dc2fe2518676c50ed418bc2c8383d449db9d1 (patch)
tree531efb3d515e6263d712cb27e3545a32aa4a8832 /lib
parent8a818b05b5df5d02cc337fff167f68e9a0399429 (diff)
downloaddrakx-kbd-mouse-x11-7e2dc2fe2518676c50ed418bc2c8383d449db9d1.tar
drakx-kbd-mouse-x11-7e2dc2fe2518676c50ed418bc2c8383d449db9d1.tar.gz
drakx-kbd-mouse-x11-7e2dc2fe2518676c50ed418bc2c8383d449db9d1.tar.bz2
drakx-kbd-mouse-x11-7e2dc2fe2518676c50ed418bc2c8383d449db9d1.tar.xz
drakx-kbd-mouse-x11-7e2dc2fe2518676c50ed418bc2c8383d449db9d1.zip
- ask "Do you wish to use proprietary driver" before installing the needed packages
Diffstat (limited to 'lib')
-rw-r--r--lib/Xconfig/card.pm33
-rw-r--r--lib/Xconfig/proprietary.pm8
2 files changed, 23 insertions, 18 deletions
diff --git a/lib/Xconfig/card.pm b/lib/Xconfig/card.pm
index 2e40890..029416b 100644
--- a/lib/Xconfig/card.pm
+++ b/lib/Xconfig/card.pm
@@ -242,8 +242,8 @@ sub configure_auto_install {
};
}
- install_server($card, $options, $do_pkgs) or return;
- $card = choose_Driver2_or_not($card, undef);
+ install_server($card, $options, $do_pkgs, undef) or return;
+ $card = configure_Driver2($card, undef);
Xconfig::various::various_auto_install($raw_X, $card, $old_X);
set_glx_restrictions($card);
@@ -274,9 +274,9 @@ sub configure {
my $card = multi_head_choose($in, $auto, @cards) or return;
- install_server($card, $options, $do_pkgs) or goto card_config__not_listed;
+ install_server($card, $options, $do_pkgs, $in) or goto card_config__not_listed;
- $card = choose_Driver2_or_not($card, $in);
+ $card = configure_Driver2($card, $in);
Xconfig::various::various($in, $raw_X, $card, $options, $auto);
set_glx_restrictions($card);
@@ -296,7 +296,7 @@ sub configure {
}
sub install_server {
- my ($card, $options, $do_pkgs) = @_;
+ my ($card, $options, $do_pkgs, $o_in) = @_;
my @packages;
my @must_have = "x11-driver-video-$card->{Driver}";
@@ -307,7 +307,13 @@ sub install_server {
if ($card->{Driver2}) {
require Xconfig::proprietary;
- push @packages, Xconfig::proprietary::pkgs_for_Driver2($card, $do_pkgs);
+ my @pkgs = Xconfig::proprietary::pkgs_for_Driver2($card, $do_pkgs);
+ if (@pkgs && (!$o_in || $o_in->ask_yesorno('', formatAlaTeX(N("There is a proprietary driver available for your video card which may support additional features.
+Do you wish to use it?")), 1))) {
+ push @packages, @pkgs;
+ } else {
+ delete $card->{Driver2};
+ }
}
$do_pkgs->ensure_are_installed([ @must_have, @packages ], 1) or
@@ -321,18 +327,17 @@ sub install_server {
1;
}
-sub choose_Driver2_or_not {
+sub configure_Driver2 {
my ($card, $o_in) = @_;
- my $card2;
if ($card->{Driver2}) {
require Xconfig::proprietary;
- $card2 = Xconfig::proprietary::may_use_Driver2($card);
- }
-
- if ($card2) {
- !$o_in || $o_in->ask_yesorno('', formatAlaTeX(N("There is a proprietary driver available for your video card which may support additional features.
-Do you wish to use it?")), 1) and $card = $card2;
+ if (my $card2 = Xconfig::proprietary::may_use_Driver2($card) && 0) {
+ $card = $card2;
+ } else {
+ $o_in && $o_in->ask_warn('', formatAlaTeX(N("The proprietary driver was not properly installed, defaulting to free software driver.")));
+ log::l("defaulting to free software driver");
+ }
}
libgl_config_and_more($card);
diff --git a/lib/Xconfig/proprietary.pm b/lib/Xconfig/proprietary.pm
index 3fae5f9..381da9e 100644
--- a/lib/Xconfig/proprietary.pm
+++ b/lib/Xconfig/proprietary.pm
@@ -44,7 +44,7 @@ sub pkgs_for_Driver2 {
my $pkg = pkg_name_for_Driver2($card);
- $pkg && $do_pkgs->is_available($pkg) or return;
+ $pkg && $do_pkgs->is_available($pkg) or log::l("proprietary package $pkg not available"), return;
my $module_pkgs = $do_pkgs->check_kernel_module_packages($pkg) or
log::l("$pkg available, but no kernel module package (for installed kernels, and no dkms)"), return;
@@ -65,7 +65,7 @@ sub may_use_Driver2 {
"$modules_dir/drivers/$drv.so",
"$modules_dir/drivers/$drv.o");
my $has = find { -e "$::prefix$_" } @l;
- $has or log::l("proprietary $drv driver missing, defaulting to free software driver (we searched for: @l)");
+ $has or log::l("proprietary $drv driver missing (we searched for: @l)");
$has;
};
@@ -80,7 +80,7 @@ sub may_use_Driver2 {
$check_drv->('nvidia_drv', "nvidia$card2->{DriverVersion}") or return;
my $libglx_path = Xconfig::card::modules_dir() . "/extensions/nvidia$card2->{DriverVersion}";
- -e "$::prefix$libglx_path/libglx.so" or log::l("special NVIDIA libglx missing, defaulting to free software driver"), return;
+ -e "$::prefix$libglx_path/libglx.so" or log::l("special NVIDIA libglx missing"), return;
log::explanations("Using specific NVIDIA driver and GLX extensions");
$card2->{DRI_GLX_SPECIAL} = $libglx_path;
@@ -89,7 +89,7 @@ sub may_use_Driver2 {
} elsif ($card2->{Driver} eq 'fglrx') {
$check_drv->('fglrx_drv') or return;
-e "$::prefix$modules_dir/dri/fglrx_dri.so" || -e "$::prefix/usr/$lib/dri/fglrx_dri.so" or
- log::l("proprietary fglrx_dri.so missing, defaulting to free software driver"), return;
+ log::l("proprietary fglrx_dri.so missing"), return;
log::explanations("Using specific ATI fglrx and DRI drivers");
$card2->{DRI_GLX} = 1;