From 034015fcb3e3b83556ab4b44d2569e86f0aa49cc Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 18 Sep 2014 03:52:32 +0000 Subject: [PATCH] branch one, openbsd tests --- inxi | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/inxi b/inxi index 21726fb..05db38d 100755 --- a/inxi +++ b/inxi @@ -5,7 +5,7 @@ #### Script Name: inxi #### Version: 2.2.5 #### Date: 2014-09-17 -#### Patch Number: 02-b1 +#### Patch Number: 03-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -4025,13 +4025,13 @@ get_cpu_data_bsd() IGNORECASE=1 } $1 ~ /^(CPU|cpu0)$/ { - if ( $NF ~ /[^0-9][0-9]+[-[:space:]]*[MG]Hz/) { - max=gensub(/.*[^0-9]([0-9]+[-[:space:]]*[MG]Hz).*/,"\\1",1,$NF) + if ( $NF ~ /[^0-9][0-9\.]+[-[:space:]]*[MG]Hz/) { + max=gensub(/.*[^0-9]([0-9\.]+[-[:space:]]*[MG]Hz).*/,"\\1",1,$NF) if (max ~ /MHz/) { - sub(/[[:space:]]*MHz/,"",max) + sub(/[-[:space:]]*MHz/,"",max) } if (max ~ /GHz/) { - sub(/[[:space:]]*GHz/,"",max) + sub(/[-[:space:]]*GHz/,"",max) max=max*1000 } print max @@ -4064,13 +4064,13 @@ get_cpu_data_bsd() if ( $NF ~ /[0-9]+[[:space:]]*[KM]B[[:space:]]+L2 cache/) { cpuCache=gensub(/.*[^0-9]([0-9]+[[:space:]]*[KM]B)[[:space:]]+L2 cach.*/,"\\1",1,$NF) } - if ( $NF ~ /[^0-9][0-9]+[-[:space:]]*[MG]Hz/) { - max=gensub(/.*[^0-9]([0-9]+[-[:space:]]*[MG]Hz).*/,"\\1",1,$NF) + if ( $NF ~ /[^0-9][0-9\.]+[-[:space:]]*[MG]Hz/) { + max=gensub(/.*[^0-9]([0-9\.]+[-[:space:]]*[MG]Hz).*/,"\\1",1,$NF) if (max ~ /MHz/) { - sub(/[[:space:]]*MHz/,"",max) + sub(/[-[:space:]]*MHz/,"",max) } if (max ~ /GHz/) { - sub(/[[:space:]]*GHz/,"",max) + sub(/[-[:space:]]*GHz/,"",max) max=max*1000 } } @@ -4115,9 +4115,12 @@ get_cpu_data_bsd() if ( cpuMax != "" ) { max=cpuMax } + if ( cpuClock == "" ) { + cpuClock="N/A" + } print cpuModel "," cpuClock "," cpuCache "," cpuFlags "," cpuBogomips "," cpuVendor # triggers print case - print "N/A," min "," max + print cpuClock "," min "," max }' <<< "$Sysctl_a_Data" ) ) IFS="$ORIGINAL_IFS" fi