From 9600ff32d386b3f8a3fe7628afc2019d8bc6f36c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 23 Sep 2009 14:14:44 +0000 Subject: (libgl_config_and_more) make it more readable --- lib/Xconfig/card.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Xconfig/card.pm b/lib/Xconfig/card.pm index f8bfdb3..924110f 100644 --- a/lib/Xconfig/card.pm +++ b/lib/Xconfig/card.pm @@ -363,10 +363,12 @@ sub libgl_config_and_more { #- ensure old deprecated conf files are not there anymore unlink("/etc/ld.so.conf.d/$_.conf") foreach 'nvidia', 'nvidia_legacy', 'ati'; - my $wanted = $card->{Driver} eq 'fglrx' ? "/etc/ld.so.conf.d/GL/ati$card->{DriverVersion}.conf" : - $card->{Driver} eq 'nvidia' ? "/etc/nvidia$card->{DriverVersion}/ld.so.conf" : - $card->{Driver} eq 'psb' ? "/etc/ld.so.conf.d/GL/libdrm-psb.conf" : - '/etc/ld.so.conf.d/GL/standard.conf'; + my %files = ( + fglrx => "/etc/ld.so.conf.d/GL/ati$card->{DriverVersion}.conf", + nvidia => "/etc/nvidia$card->{DriverVersion}/ld.so.conf", + psb => "/etc/ld.so.conf.d/GL/libdrm-psb.conf", + ); + my $wanted = $files{$card->{Driver}} || '/etc/ld.so.conf.d/GL/standard.conf'; my $link = "$::prefix/etc/alternatives/gl_conf"; my $need_run_ldconfig = readlink($link) ne $wanted; -e "$::prefix$wanted" or log::l("ERROR: $wanted does not exist, linking $link to it anyway"); -- cgit v1.2.1