test one for eee bug

This commit is contained in:
inxi-svn 2008-12-13 19:56:44 +00:00
parent a5d5324797
commit 6de93b726f

148
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.7.1-b1-t7 #### version: 0.8.5-b1-t1
#### Date: December 3 2008 #### Date: December 12 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
#### As time permits functionality improvements and recoding will occur. #### As time permits functionality improvements and recoding will occur.
@ -152,7 +152,9 @@ B_X_RUNNING='false'
if [[ -n $DISPLAY ]];then if [[ -n $DISPLAY ]];then
B_X_RUNNING='true' B_X_RUNNING='true'
fi fi
if [[ $B_TESTING_1 == 'true' ]];then
echo B_X_RUNNING: $B_X_RUNNING
fi
### Variable initializations: constants ### Variable initializations: constants
DCOPOBJ="default" DCOPOBJ="default"
DEBUG=0 # Set debug levels from 1-10 DEBUG=0 # Set debug levels from 1-10
@ -1933,12 +1935,14 @@ get_partition_data()
/\/$|\/boot$|\/var$|\/home$|\/tmp$|\/usr$/ && ! /aufs/ { /\/$|\/boot$|\/var$|\/home$|\/tmp$|\/usr$/ && ! /aufs/ {
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",main" print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",main"
} }
# skip all these, including the first, header line. Use the --exclude-type
# to handle new filesystems types we do not want listed here
! /\/$|\/boot$|\/var$|\/home$|\/tmp$|\/usr$|^filesystem/ { ! /\/$|\/boot$|\/var$|\/home$|\/tmp$|\/usr$|^filesystem/ {
# this is to avoid file systems with spaces in their names, that will make # this is to avoid file systems with spaces in their names, that will make
# the test show the wrong data in each of the fields, if no x%, then do not use # the test show the wrong data in each of the fields, if no x%, then do not use
if ( $(NF - 1) ~ /[0-9]+\%/ ) { if ( $(NF - 1) ~ /[0-9]+\%/ ) {
# cleaning up user name here to avoid showing too much info on irc # cleaning up user name here to avoid showing too much info on irc
partitionName=gensub( /^\/home\/(.*)\/(.*)/, "/home/<username>/\\2", 1, $NF ) partitionName=gensub( /^\/home\/(.*)\/(.*)/, "/home/###/\\2", 1, $NF )
print partitionName "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary" print partitionName "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary"
} }
} }
@ -2335,32 +2339,30 @@ print_cpu_data()
# args: $1 - cpu flag string # args: $1 - cpu flag string
print_cpu_flags_full() print_cpu_flags_full()
{ {
local cpu_flags_full="$1" cpu_flags_1='' cpu_flags_2='' cpu_flags_3='' flag_data='' local cpu_flags_full="$1" a_cpu_flags='' line_starter=''
local i=0 flag='' local i=0 counter=0 max_length=18 max_length_add=18 flag='' flag_data=''
# build the flag line array
for flag in $cpu_flags_full for flag in $cpu_flags_full
do do
if [[ $i -ge 36 ]];then a_cpu_flags[$counter]="${a_cpu_flags[$counter]}$flag "
cpu_flags_3="$cpu_flags_3$flag " if [[ $i -ge $max_length ]];then
elif [[ $i -ge 18 ]];then (( counter++ ))
cpu_flags_2="$cpu_flags_2$flag " max_length=$(( $max_length + $max_length_add ))
elif [[ $i -ge 0 ]];then
cpu_flags_1="$cpu_flags_1$flag "
fi fi
((i++)) ((i++))
done done
if [[ -n $cpu_flags_1 ]];then # then print it out
flag_data=$( create_print_line " " "${C1}CPU Flags${C2} $cpu_flags_1" ) for (( i=0; i < ${#a_cpu_flags[@]};i++ ))
print_screen_output "$flag_data" do
if [[ $i -eq 0 ]];then
line_starter="${C1}CPU Flags${C2} "
else
line_starter=''
fi fi
if [[ -n $cpu_flags_2 ]];then flag_data=$( create_print_line " " "$line_starter${a_cpu_flags[$i]}" )
flag_data=$( create_print_line " " "$cpu_flags_2" )
print_screen_output "$flag_data" print_screen_output "$flag_data"
fi done
if [[ -n $cpu_flags_3 ]];then
flag_data=$( create_print_line " " "$cpu_flags_3" )
print_screen_output "$flag_data"
fi
} }
print_gfx_data() print_gfx_data()
@ -2405,7 +2407,7 @@ print_gfx_data()
## note: if glx render or version have no content, then mesa is true ## note: if glx render or version have no content, then mesa is true
if [[ $B_X_RUNNING == 'true' && $b_is_mesa != 'true' ]];then if [[ $B_X_RUNNING == 'true' && $b_is_mesa != 'true' ]];then
gfx_data=$( create_print_line " " "${C1}GLX Renderer${C2} ${glx_renderer} ${CN}| ${C1}GLX Version${C2} ${glx_version}${CN}" ) gfx_data=$( create_print_line " " "${C1}GLX Renderer${C2} ${glx_renderer} ${C1}GLX Version${C2} ${glx_version}${CN}" )
if [[ $B_HANDLE_CORRUPT_DATA == 'true' ]];then if [[ $B_HANDLE_CORRUPT_DATA == 'true' ]];then
gfx_data="${gfx_data} ${C1}Direct rendering${C2} ${glx_direct_render}${CN}" gfx_data="${gfx_data} ${C1}Direct rendering${C2} ${glx_direct_render}${CN}"
fi fi
@ -2624,14 +2626,17 @@ print_networking_ip_data()
print_partition_data() print_partition_data()
{ {
local a_partition_working='' partition_used='' swap='' partition_data='' partition_data_2='' local a_partition_working='' partition_used='' swap='' partition_data=''
local partition_data_3='' partition_data_4='' partition_data_5='' partition_data_6='' local counter=0 line_max=160 i=0 a_partition_data='' line_starter=''
local partition_data_7='' partition_data_8='' counter=1 line_max=160
# this handles the different, shorter, irc colors strings embedded in variable data # this handles the different, shorter, irc colors strings embedded in variable data
if [[ $B_RUNNING_IN_SHELL != 'true' ]];then if [[ $B_RUNNING_IN_SHELL != 'true' ]];then
line_max=130 line_max=130
fi fi
# and no color string data at all
if [[ $SCHEME -eq 0 ]];then
line_max=75
fi
# set A_PARTITION_DATA # set A_PARTITION_DATA
get_partition_data get_partition_data
@ -2654,88 +2659,23 @@ print_partition_data()
swap='' swap=''
fi fi
# because these lines can vary widely, using dynamic length handling here # because these lines can vary widely, using dynamic length handling here
case $counter in a_partition_data[$counter]="${a_partition_data[$counter]}${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
1) if [[ $( wc -c <<< ${a_partition_data[$counter]} ) -gt $line_max ]];then
partition_data="$partition_data${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used " ((counter++))
if [[ $( wc -c <<< $partition_data ) -gt $line_max ]];then
counter=2
fi fi
;;
2)
partition_data_2="$partition_data_2${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
if [[ $( wc -c <<< $partition_data_2 ) -gt $line_max ]];then
counter=3
fi
;;
3)
partition_data_3="$partition_data_3${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
if [[ $( wc -c <<< $partition_data_3 ) -gt $line_max ]];then
counter=4
fi
;;
4)
partition_data_4="$partition_data_4${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
if [[ $( wc -c <<< $partition_data_4 ) -gt $line_max ]];then
counter=5
fi
;;
5)
partition_data_5="$partition_data_5${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
if [[ $( wc -c <<< $partition_data_5 ) -gt $line_max ]];then
counter=6
fi
;;
6)
partition_data_6="$partition_data_6${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
if [[ $( wc -c <<< $partition_data_6 ) -gt $line_max ]];then
counter=7
fi
;;
7)
partition_data_7="$partition_data_7${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
if [[ $( wc -c <<< $partition_data_7 ) -gt $line_max ]];then
counter=8
fi
;;
*)
partition_data_8="$partition_data_8${C1}ID:${C2}$swap${a_partition_working[0]} ${C1}size:${C2} ${a_partition_working[1]}$partition_used "
;;
esac
fi fi
done done
# create the first line # print out all lines, line starter on first line
partition_data=$( create_print_line "Partition:" "$partition_data" ) for (( i=0; i < ${#a_partition_data[@]};i++ ))
do
if [[ $i -eq 0 ]];then
line_starter='Partition:'
else
line_starter=' '
fi
partition_data=$( create_print_line "$line_starter" "${a_partition_data[$i]}" )
print_screen_output "$partition_data" print_screen_output "$partition_data"
done
# then the rest, if required
if [[ -n $partition_data_2 ]];then
partition_data_2=$( create_print_line " " "$partition_data_2" )
print_screen_output "$partition_data_2"
fi
if [[ -n $partition_data_3 ]];then
partition_data_3=$( create_print_line " " "$partition_data_3" )
print_screen_output "$partition_data_3"
fi
if [[ -n $partition_data_4 ]];then
partition_data_4=$( create_print_line " " "$partition_data_4" )
print_screen_output "$partition_data_4"
fi
if [[ -n $partition_data_5 ]];then
partition_data_5=$( create_print_line " " "$partition_data_5" )
print_screen_output "$partition_data_5"
fi
if [[ -n $partition_data_6 ]];then
partition_data_6=$( create_print_line " " "$partition_data_6" )
print_screen_output "$partition_data_6"
fi
if [[ -n $partition_data_7 ]];then
partition_data_7=$( create_print_line " " "$partition_data_7" )
print_screen_output "$partition_data_7"
fi
if [[ -n $partition_data_8 ]];then
partition_data_8=$( create_print_line " " "$partition_data_8" )
print_screen_output "$partition_data_8"
fi
} }
print_system_data() print_system_data()