(change version)

bug fix for cpu data. Make sure all cpu counts are > 1 for tests.
This commit is contained in:
inxi-svn 2009-08-05 00:26:28 +00:00
parent a2c6aabcd8
commit 2201b388c9

22
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.1.9
#### Date: August 3 2009
#### version: 1.1.10
#### Date: August 4 2009
########################################################################
#### SPECIAL THANKS
########################################################################
@ -146,7 +146,8 @@
## NOTE: we can use hwinfo if it's available in all systems, or most, to get
## a lot more data and verbosity levels going
# set to default LANG to avoid locales errors with , or .
LANG=C
### Variable initializations: null values
CMDL_MAX=''
COLOR_SCHEME=''
@ -1998,7 +1999,7 @@ get_cpu_ht_multicore_smp_data()
# looking at logical processor counts over 1, which means either HT, SMP or MCP
# http://en.wikipedia.org/wiki/Symmetric_multiprocessing
if ( processor_logical_count > 1 ) {
if ( processor_logical_count > 1 && core_count > 1 ) {
if ( processor_logical_count > core_count && physical_cpu_count > 1 ) {
type = "SMP-HT" # could be Xeon/P4 HT dual cpu
}
@ -3263,7 +3264,7 @@ get_sensors_data()
if ( cpuTempReal == "" && core0Temp != "" ) {
cpuTempReal=core0Temp
}
# then the real mobo temp
if ( moboTemp != "" ){
moboTempReal=moboTemp
@ -3285,9 +3286,11 @@ get_sensors_data()
# because that creates an array item in gawk just by the test itself
if ( tempFanType == 1 && 1 in aFanDefault ) {
aFanMain[1]=aFanDefault[1]
aFanDefault[1]=""
}
else if ( tempFanType == 2 && 2 in aFanDefault ) {
aFanMain[1]=aFanDefault[2]
aFanDefault[2]=""
}
}
@ -3314,7 +3317,13 @@ get_sensors_data()
}
}
# now see if you can find the fast little mobo fan, > 5000 rpm and put it as mobo
# note that gawk is returning true for some test cases when aFanDefault[j] < 5000
# which has to be a gawk bug, unless there is something really weird with arrays
# note: 500 > aFanDefault[j] < 1000 is the exact trigger, and if you manually
# assign that value below, the > 5000 test works again, and a print of the value
# shows the proper value, so the corruption might be internal in awk.
for (j = 1; j <= indexCountaFanDefault; j++) {
if ( j in aFanDefault && aFanDefault[j] > 5000 && aFanMain[2] == "" ) {
aFanMain[2] = aFanDefault[j]
@ -3326,7 +3335,8 @@ get_sensors_data()
}
}
# then construct the sys_fan string for echo
# then construct the sys_fan string for echo, note that iteration 1
# makes: fanDefaultString separator null, ie, no space or ,
for (j = 1; j <= indexCountaFanDefault; j++) {
fanDefaultString = fanDefaultString separator aFanDefault[j]
separator=","