From a19125c8c70326b7913fe79172c462ae11216756 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sun, 17 Aug 2014 19:04:20 +0000 Subject: [PATCH] New version, new tarball. Fixed bad assumption, DMI type 0 is not always before other types, in at least one case, it is last, so can't use that as trigger to start loop. Now using: Table at .. which is always at start of dmi output. Also, changed size output per module to be in MB GB TB instead of all mB, since modules are sold by GB or MB, the data should show that as well. Also shortens output. --- inxi | 38 +++++++++++++++++++++++++++++++------- inxi.changelog | 18 ++++++++++++++++++ 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/inxi b/inxi index 71fd71d..c844167 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/usr/bin/env bash ######################################################################## #### Script Name: inxi -#### Version: 2.1.97 -#### Date: 2014-08-16 +#### Version: 2.1.98 +#### Date: 2014-08-17 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -8154,7 +8154,6 @@ get_ram_data() aArrayData[0,"deviceCount16"]=0 aArrayData[0,"deviceCountFound"]=0 aArrayData[0,"moduleVoltage5"]="" - moduleVoltage="" numberOfDevices="" primaryType="" @@ -8163,7 +8162,6 @@ get_ram_data() i=0 j=0 k=0 - bDebugger1="false" dDebugger2="false" bType5="false" @@ -8188,7 +8186,7 @@ get_ram_data() } return size } - /^Handle .* DMI[[:space:]]+type[[:space:]]+[0](,|[[:space:]])/ { + /^Table[[:space:]]+at[[:space:]]/ { bType5="false" # we need to start count here because for testing > 1 array, and we want always to have # the actual module data assigned to the right primary array, even when it is out of @@ -8305,7 +8303,13 @@ get_ram_data() aArrayData[k,"usedCapacity"]=workingSize + aArrayData[k,"usedCapacity"] } # print aArrayData[k,"derivedModuleSize"] " dm:" k ":mm " aMaxModuleSize[k] " uc:" aArrayData[k,"usedCapacity"] - deviceSize=$2 + # we want any non real size data to be preserved + if ( $2 ~ /^[0-9]+[[:space:]]*[MTPG]B/ ) { + deviceSize=workingSize + } + else { + deviceSize=$2 + } } if ( $1 == "Locator") { # sub(/.*_/,"",$2) @@ -8570,7 +8574,27 @@ get_ram_data() # print device rows next for ( j=0;j<=100;j++ ) { if (aMemory[m,j,0] != "" ) { - print aMemory[m,j,0] "," aMemory[m,j,1] "," aMemory[m,j,2] "," aMemory[m,j,3] "," aMemory[m,j,4] "," aMemory[m,j,5] "," aMemory[m,j,6] "," aMemory[m,j,7] "," aMemory[m,j,8] "," aMemory[m,j,9] "," aMemory[m,j,10] "," aMemory[m,j,11] "," aMemory[m,j,12] "," aMemory[m,j,13] "," aMemory[m,j,14] "," aMemory[m,j,15] "," aMemory[m,j,16] "," aMemory[m,j,17] + unit="" + workingSize=aMemory[m,j,2] + if ( workingSize ~ /^[0-9]+$/ ) { + workingSize=int(workingSize) + if ( workingSize < 1024 ) { + workingSize = workingSize + unit=" MB" + } + else if ( workingSize < 1024000 ) { + workingSize = workingSize / 1024 + unit=" GB" + } + else if ( workingSize < 1024000000 ) { + workingSize = workingSize / 1024000 + unit=" TB" + } + # we only want a max 2 decimal places, this trick gives 0 to 2 + workingSize=gensub(/([0-9]+\.[0-9][0-9]).*/,"\\1",1,workingSize) + workingSize = workingSize unit + } + print aMemory[m,j,0] "," aMemory[m,j,1] "," workingSize "," aMemory[m,j,3] "," aMemory[m,j,4] "," aMemory[m,j,5] "," aMemory[m,j,6] "," aMemory[m,j,7] "," aMemory[m,j,8] "," aMemory[m,j,9] "," aMemory[m,j,10] "," aMemory[m,j,11] "," aMemory[m,j,12] "," aMemory[m,j,13] "," aMemory[m,j,14] "," aMemory[m,j,15] "," aMemory[m,j,16] "," aMemory[m,j,17] } else { break diff --git a/inxi.changelog b/inxi.changelog index 93a4978..a268be0 100755 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,21 @@ +===================================================================================== +Version: 2.1.98 +Patch Version: 00 +Script Date: 2014-08-17 +----------------------------------- +Changes: +----------------------------------- +New version, new tarball. Fixed bad assumption, DMI type 0 is not always before other +types, in at least one case, it is last, so can't use that as trigger to start loop. + +Now using: Table at .. which is always at start of dmi output. + +Also, changed size output per module to be in MB GB TB instead of all mB, since modules +are sold by GB or MB, the data should show that as well. Also shortens output. + +----------------------------------- +-- Harald Hope - Sun, 17 Aug 2014 12:01:38 -0700 + ===================================================================================== Version: 2.1.97 Patch Version: 00