summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/card.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-09-16 14:05:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-09-16 14:05:53 +0000
commit12540853e8b4439f46b10d7a9ed65faddfb3ab62 (patch)
tree496911735b89dc99603473edf72c61e98926ae67 /perl-install/Xconfig/card.pm
parentb15901a3b7983a00c3a80c7a8ecf09a58f744095 (diff)
downloaddrakx-12540853e8b4439f46b10d7a9ed65faddfb3ab62.tar
drakx-12540853e8b4439f46b10d7a9ed65faddfb3ab62.tar.gz
drakx-12540853e8b4439f46b10d7a9ed65faddfb3ab62.tar.bz2
drakx-12540853e8b4439f46b10d7a9ed65faddfb3ab62.tar.xz
drakx-12540853e8b4439f46b10d7a9ed65faddfb3ab62.zip
instead of symlinking, comment the content of the ld.so.conf.d/*.conf
Diffstat (limited to 'perl-install/Xconfig/card.pm')
-rw-r--r--perl-install/Xconfig/card.pm36
1 files changed, 20 insertions, 16 deletions
diff --git a/perl-install/Xconfig/card.pm b/perl-install/Xconfig/card.pm
index 23e1d1e18..2151406d3 100644
--- a/perl-install/Xconfig/card.pm
+++ b/perl-install/Xconfig/card.pm
@@ -459,27 +459,31 @@ sub set_glx_restrictions {
sub libgl_config {
my ($Driver) = @_;
- my $dir = "$::prefix/etc/ld.so.conf.d/";
+ my $dir = "$::prefix/etc/ld.so.conf.d";
+ my $comment = '# commented-by-DrakX ';
my %driver_to_libgl_config = (
- nvidia => '.nvidia.conf',
- fglrx => '.ati.conf',
+ nvidia => 'nvidia.conf',
+ fglrx => 'ati.conf',
);
my $need_to_run_ldconfig;
- my $link = "$dir/GL.conf";
- if (my $file = $driver_to_libgl_config{$Driver}) {
- if (-e "$dir/$file" && readlink($link) ne $file) {
- symlinkf($file, "$dir/GL.conf");
- $need_to_run_ldconfig = 1;
- log::explanations("ldconfig will be run because the GL library was enabled");
- }
- } elsif (-e $link) {
- eval { rm_rf($link) };
- $need_to_run_ldconfig = 2;
- log::explanations("ldconfig will be run because the GL library was disabled");
-
+ my $wanted = $driver_to_libgl_config{$Driver};
+ foreach my $file (values %driver_to_libgl_config) {
+ substInFile {
+ my ($commented, $s) = /^($comment)?(.*)/;
+ if ($file eq $wanted) {
+ $_ = "$s\n";
+ $need_to_run_ldconfig ||= $commented;
+ } else {
+ $_ = "$comment$s\n";
+ $need_to_run_ldconfig ||= !$commented;
+ }
+ } "$dir/$file";
+ }
+ if ($::isStandalone && $need_to_run_ldconfig) {
+ log::explanations("ldconfig will be run because the GL library was " . ($wanted ? 'enabled' : 'disabled'));
+ system("/sbin/ldconfig");
}
- system("/sbin/ldconfig") if $::isStandalone && $need_to_run_ldconfig;
}
sub add_to_card__using_Cards {