From bff32dc844db502574237528e1e251c4c2ce7728 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 18 Jun 2011 02:59:58 +0000 Subject: [PATCH] handling of tsst corp string --- inxi | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/inxi b/inxi index 1fed457..aaa8a12 100755 --- a/inxi +++ b/inxi @@ -4548,8 +4548,7 @@ get_optical_drive_data() sys_path=$( ls /sys/devices/pci*/*/host*/target*/*/block/$disk/uevent 2>/dev/null | sed "s|/block/$disk/uevent||" ) # no need to test for errors yet, probably other user systems will require some alternate paths though if [[ -n $sys_path ]];then - vendor=$( cat $sys_path/vendor 2>/dev/null | \ - sed -E -e 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' -e 's/TSSTcorp/TSST /' -e 's/('"$BAN_LIST_NORMAL"')//g' ) + vendor=$( cat $sys_path/vendor 2>/dev/null | sed -e 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' ) model=$( cat $sys_path/model 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' ) state=$( cat $sys_path/state 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' ) rev_number=$( cat $sys_path/rev 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' ) @@ -4557,6 +4556,19 @@ get_optical_drive_data() elif [[ -e /proc/ide/$disk/model ]];then vendor=$( cat /proc/ide/$disk/model 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/,//g' ) fi + if [[ -n $vendor ]];then + vendor=$( gawk ' + BEGIN { + IGNORECASE=1 + } + { + gsub(/'"$BAN_LIST_NORMAL"'/, "", $0) + sub(/TSSTcorp/, "TSST ", $0) # seen more than one of these weird ones + print $0 + } + ' <<< $vendor + ) + fi if [[ $B_EXTRA_DATA == 'true' && -n $proc_cdrom ]];then cpuinfo_string=$( gawk -v diskId=$disk '