cleaned up, only check file once

This commit is contained in:
inxi-svn 2011-05-23 22:36:25 +00:00
parent bb8f7e279c
commit 1fc7e1ad46

20
inxi
View file

@ -3196,18 +3196,20 @@ get_graphics_driver()
eval $LOGFS eval $LOGFS
local driver_list='apm ark ati chips cirrus cyrix fbdev fglrx glint i128 i740 intel i810 imstt mach64 mga neomagic nsc nv nvidia openchrome nouveau radeon radeonhd rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng unichrome vesa vga via voodoo vmware v4l' local driver_list='apm ark ati chips cirrus cyrix fbdev fglrx glint i128 i740 intel i810 imstt mach64 mga neomagic nsc nv nvidia openchrome nouveau radeon radeonhd rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng unichrome vesa vga via voodoo vmware v4l'
local driver='' driver_string='' spacer='' local driver='' driver_string='' spacer='' xorg_log_data=''
if [[ $B_XORG_LOG == 'true' ]];then if [[ $B_XORG_LOG == 'true' ]];then
for driver in $driver_list xorg_log_data="$( cat $FILE_XORG_LOG )"
do for driver in $driver_list
if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" $FILE_XORG_LOG ) && -z $( grep -s "[[:space:]]Unloading.*${driver}_drv.so" $FILE_XORG_LOG ) ]];then do
driver_string="$driver_string$driver$spacer" if [[ -n $( grep -s "[[:space:]]Loading.*${driver}_drv.so" <<< "$xorg_log_data" ) && -z $( grep -s "[[:space:]]Unloading.*${driver}_drv.so" <<< "$xorg_log_data" ) ]];then
spacer=' ' driver_string="$driver_string$driver$spacer"
fi spacer=' '
done fi
done
xorg_log_data='' # dump from ram, does it matter?
fi fi
echo $driver_string echo $driver_string
eval $LOGFE eval $LOGFE
} }