diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2005-05-22 10:08:21 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2005-05-22 10:08:21 +0000 |
commit | debdd196963e5857d07bf4520ded517157835cc4 (patch) | |
tree | 70e564dceed596f29fece71898b78c47069e5c21 | |
parent | b965950286c29c1777c89346c63b2c91be23a9f2 (diff) | |
download | drakx-backup-do-not-use-debdd196963e5857d07bf4520ded517157835cc4.tar drakx-backup-do-not-use-debdd196963e5857d07bf4520ded517157835cc4.tar.gz drakx-backup-do-not-use-debdd196963e5857d07bf4520ded517157835cc4.tar.bz2 drakx-backup-do-not-use-debdd196963e5857d07bf4520ded517157835cc4.tar.xz drakx-backup-do-not-use-debdd196963e5857d07bf4520ded517157835cc4.zip |
(libgl_config) only run ldconfig if needed (aka only if GL config was altered)
-rw-r--r-- | perl-install/Xconfig/card.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/perl-install/Xconfig/card.pm b/perl-install/Xconfig/card.pm index 63a60f8e7..766327b20 100644 --- a/perl-install/Xconfig/card.pm +++ b/perl-install/Xconfig/card.pm @@ -457,12 +457,21 @@ sub libgl_config { nvidia => '.conf.nvidia', fglrx => '.conf.ati', ); + my $need_to_run_ldconfig; + my $link = "$dir/GL.conf"; if (my $file = $driver_to_libgl_config{$Driver}) { - symlinkf($file, "$dir/GL.conf") if -e "$dir/$file"; - } else { - eval { rm_rf("$dir/GL.conf") }; + 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"); + } - system("/sbin/ldconfig") if $::isStandalone; + system("/sbin/ldconfig") if $::isStandalone && $need_to_run_ldconfig; } sub add_to_card__using_Cards { |