From 5f09b1555c3b8a8863821413778bf7b7b3bff0f1 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 14 Aug 2014 04:08:54 +0000 Subject: [PATCH] some bug fixes, a small glitch, added debuggers --- inxi | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/inxi b/inxi index 26e7b2d..4a16e02 100755 --- a/inxi +++ b/inxi @@ -4888,8 +4888,8 @@ get_dmidecode_data() { eval $LOGFS - local dmiData="" - + local dmiData="" b_debugger='false' + if [[ $B_DMIDECODE_SET != 'true' ]];then dmidecodePath=$( type -p dmidecode 2>/dev/null ) if [[ -z $dmidecodePath ]];then @@ -4900,8 +4900,12 @@ get_dmidecode_data() # used to separate results. Then we remove the doubled empty lines to keep it clean and # strip out all the stuff we don't want to see in the results. We want the error data in # stdout for error handling - # DMIDECODE_DATA="$( echo "$dmiData" | gawk -F ':' ' - DMIDECODE_DATA="$( $dmidecodePath 2>&1 | gawk -F ':' ' + if [[ $b_debugger == 'true' ]];then + dmiData="$( cat ~/bin/scripts/inxi/data/dmidecode/dmidecode-memory-variants-1.txt )" + else + dmiData="$( $dmidecodePath 2>&1 )" + fi + DMIDECODE_DATA="$( echo "$dmiData" | gawk -F ':' ' BEGIN { IGNORECASE=1 cutExtraTab="false" @@ -8369,9 +8373,12 @@ get_ram_data() if ( a_memory[j,3] == 0 ) { a_memory[j,3] = "" } - # print "mms:" aMaxModuleSize[m] ":dms:" aDerivedModuleSize[m] + else { + a_memory[j,3]=int(a_memory[j,3]) # some weird cases believe they are strings! + } + #print "mms:" aMaxModuleSize[m] ":dms:" aDerivedModuleSize[m] ":mc:" a_memory[j,3] if (aMaxModuleSize[m] != 0 && aDerivedModuleSize[m] != 0 && aDerivedModuleSize[m] > aMaxModuleSize[m]){ - aMaxModuleSize[m]=aDerivedModuleSize[m] + aMaxModuleSize[m]=int(aDerivedModuleSize[m]) estModuleSize=" (est.)" } if (aMaxModuleSize[m] == 0 ){ @@ -8384,13 +8391,13 @@ get_ram_data() estCap=" (est)" } } - # print "mms:" aMaxModuleSize[m] ":dms:" aDerivedModuleSize[m] ":mc:" a_memory[j,3] + #print "mms:" aMaxModuleSize[m] ":dms:" aDerivedModuleSize[m] ":mc:" a_memory[j,3] # some cases of type 5 have too big module max size, just dump the data then if ( aMaxModuleSize[m] != "" && a_memory[j,3] != "" && ( aMaxModuleSize[m] > a_memory[j,3] ) ){ aMaxModuleSize[m] = "" + # print "yes" } if (a_memory[j,3] != "" ) { - a_memory[j,3]=int(a_memory[j,3]) # some weird cases believe they are strings! if ( a_memory[j,3] < 1024 ) { a_memory[j,3] = a_memory[j,3] unit=" MB"