fine tunings to avoid some possible errors

This commit is contained in:
inxi-svn 2011-07-06 03:54:25 +00:00
parent 0473aef0a0
commit 96784d1073

35
inxi
View file

@ -3,7 +3,7 @@
#### Script Name: inxi #### Script Name: inxi
#### version: 1.7.13 #### version: 1.7.13
#### Date: July 5 2011 #### Date: July 5 2011
#### Patch Number: 07 #### Patch Number: 08
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -3485,6 +3485,8 @@ get_gcc_kernel_version()
get_gcc_system_version() get_gcc_system_version()
{ {
eval $LOGFS
local separator='' gcc_installed='' gcc_list='' gcc_others='' temp_array=''
local gcc_version=$( local gcc_version=$(
gcc --version 2>/dev/null | sed -E 's/\([^\)]*\)//g' | gawk ' gcc --version 2>/dev/null | sed -E 's/\([^\)]*\)//g' | gawk '
BEGIN { BEGIN {
@ -3495,25 +3497,30 @@ get_gcc_system_version()
exit exit
}' }'
) )
local gcc_others=$( ls /usr/bin/gcc-* )
local separator='' gcc_installed='' gcc_list=''
# can't use xargs -l basename because not all systems support thats # can't use xargs -l basename because not all systems support thats
if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
for item in $gcc_others gcc_others=$( ls /usr/bin/gcc-* 2>/dev/null )
do if [[ -n $gcc_others ]];then
gcc_installed=$( basename $item | gawk -F '-' ' for item in $gcc_others
$2 ~ /^[0-9\.]+$/ { do
print $2 gcc_installed=$( basename $item | gawk -F '-' '
}' ) $2 ~ /^[0-9\.]+$/ {
if [[ -n $gcc_installed && -z $( grep "^$gcc_installed" <<< $gcc_version ) ]];then print $2
gcc_list=$gcc_list$separator$gcc_installed }' )
separator=',' if [[ -n $gcc_installed && -z $( grep "^$gcc_installed" <<< $gcc_version ) ]];then
fi gcc_list=$gcc_list$separator$gcc_installed
done separator=','
fi
done
fi
fi fi
if [[ -n $gcc_version ]];then if [[ -n $gcc_version ]];then
A_GCC_VERSIONS=( "$gcc_version" $gcc_list ) A_GCC_VERSIONS=( "$gcc_version" $gcc_list )
fi fi
temp_array=${A_GCC_VERSIONS[@]}
log_function_data "A_GCC_VERSIONS: $temp_array"
eval $LOGFE
} }
get_gpu_temp_data() get_gpu_temp_data()
{ {