From bba4e30abd4cbeaf7115f54ccdcd792d28c3d918 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 8 Jun 2011 05:13:55 +0000 Subject: [PATCH] trying another way of handling false system/mobo data matches, msi is the culprit here --- inxi | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 26cdc4e..cc9e96b 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.5.993 +#### version: 1.5.994 #### Date: June 7 2011 ######################################################################## #### SPECIAL THANKS @@ -5963,10 +5963,19 @@ print_machine_data() if [[ ${#A_MACHINE_DATA[@]} -gt 0 ]];then # note: in some case a mobo/version will match a product name/version, do not print those - # some special cases, with: System MSI product MS-7680/Mobo MSI model H61M-P23 (MS-7680) - if [[ -n ${A_MACHINE_DATA[1]} && -n ${A_MACHINE_DATA[6]} && ${A_MACHINE_DATA[1]} == ${A_MACHINE_DATA[6]} ]] || \ - [[ -z ${A_MACHINE_DATA[0]} ]];then + + if [[ -z ${A_MACHINE_DATA[0]} ]];then b_skip_system='true' + elif [[ -n ${A_MACHINE_DATA[1]} && -n ${A_MACHINE_DATA[6]} ]];then + # some special cases, with: System MSI product MS-7680/Mobo MSI model H61M-P23 (MS-7680) + # do not match, but I think the data is worth keeping since the first string might be the + # actual version number you see on the box of the mobo. So here we dump system if the longer + # mobo model string contains the system version data and the vendors are the same + if [[ ${A_MACHINE_DATA[1]} == ${A_MACHINE_DATA[6]} ]] || \ + [[ -n ${A_MACHINE_DATA[0]} && ${A_MACHINE_DATA[0]} == ${A_MACHINE_DATA[5]} && \ + -n $( grep ${A_MACHINE_DATA[1]} <<< ${A_MACHINE_DATA[6]} ) ]];then + b_skip_system='true' + fi fi # no point in showing chassis if system isn't there, it's very unlikely that would be correct if [[ $B_EXTRA_EXTRA_DATA == 'true' && $b_skip_system != 'true' ]];then