(change version)

fixed bug in sse output for flags
This commit is contained in:
inxi-svn 2010-03-05 22:36:09 +00:00
parent dc8706cfa7
commit 32da9c7a7f

52
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.4.7
#### Date: March 4 2010
#### version: 1.4.8
#### Date: March 5 2010
########################################################################
#### SPECIAL THANKS
########################################################################
@ -3943,55 +3943,45 @@ calculate_multicore_data()
process_cpu_flags()
{
eval $LOGFS
local cpu_flags="$1"
# must have a space after last item in list for RS=" "
local cpu_flags_working="$1 "
# nx = AMD stack protection extensions
# lm = Intel 64bit extensions
# sse, sse2, pni = sse1,2,3,4,5 gfx extensions
# svm = AMD pacifica virtualization extensions
# vmx = Intel IVT (vanderpool) virtualization extensions
cpu_flags=$( echo "$cpu_flags" | gawk '
cpu_flags=$(
echo "$cpu_flags_working" | gawk '
BEGIN {
RS=" "
a_ssel["sse"] = 1
a_ssel["sse2"] = 2
a_ssel["pni"] = 3
a_ssel["sse4a"] = 4 # 4a must precede 4
a_ssel["sse4"] = 5
a_ssel["sse5"] = 6
a_sses[1] = "sse"
a_sses[2] = "sse2"
a_sses[3] = "sse3"
a_sses[4] = "sse4a"
a_sses[5] = "sse4"
a_sses[6] = "sse5"
sseCounter = 0
count = 0
i = 1 # start at one because of for increment issue
flag_string = ""
}
/^(nx|lm|svm|vmx)$/ {
if ( flag_string != "" ) {
flag_string = flag_string " " $0
/^(lm|nx|pni|svm|vmx|(sss|ss)e([2-9])?([a-z])?(_[0-9])?)$/ {
if ( $0 == "pni" ){
a_flags[i] = "sse3"
}
else {
flag_string = $0
}
}
/^(sse|sse2|sse4a|sse4|sse5|pni)$/ {
if ( a_ssel[$0] > sseCounter ) {
sseCounter = a_ssel[$0]
a_flags[i] = $0
}
i++
}
END {
if ( sseCounter > 0 ) {
if ( flag_string != "" ) {
flag_string = a_sses[sseCounter] " " flag_string
count = asort( a_flags )
# note: why does gawk increment before the loop and not after? weird.
for ( i=0; i <= count; i++ ){
if ( flag_string == "" ) {
flag_string = a_flags[i]
}
else {
flag_string = a_sses[sseCounter]
flag_string = flag_string " " a_flags[i]
}
}
print flag_string
}' )
}'
)
#grep -oE '\<(nx|lm|sse[0-9]?|pni|svm|vmx)\>' | tr '\n' ' '))
if [[ -z $cpu_flags ]];then