From e9372be01eb8e9f14d49fe5e3a6d2e805a242912 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 18 Jun 2011 00:52:38 +0000 Subject: [PATCH] patch 5, more fixes --- inxi | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/inxi b/inxi index a5f31ce..a66e2b2 100755 --- a/inxi +++ b/inxi @@ -480,7 +480,7 @@ DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release" # $'\1' gets weird results : # user@host $ ARR=($'\x01'"one two" three four); echo ${ARR[0]} | hd -v # 00000000 01 01 6f 6e 65 20 74 77 6f 0a |..one two.| -A_NORMAL_BANS=( computing computer corporation communications electronics electrical electric gmbh group industrial international revision software technologies technology $'\2'"\" ltd. ltd $'\2'"\" intl. inc. $'\2'\ co. corp. "(tm)" "(r)" "®" $'\2'"\(rev ..\)" ) +A_NORMAL_BANS=( computing computer corporation communications electronics electrical electric gmbh group industrial international revision software technologies technology $'\2'"\" ltd. ltd $'\2'"\" intl. inc. $'\2'\ co. corp. corp "(tm)" "(r)" "®" $'\2'"\(rev ..\)" ) A_CPU_BANS=( @ cpu deca 'dual core' dual-core 'tri core' tri-core 'quad core' quad-core ennea genuine hepta hexa multi octa penta 'processor' processor single triple $'\2'"[0-9.]+ *[MmGg][Hh][Zz]" ) # after processing, the ban arrays will be put into these: BAN_LIST_NORMAL='' @@ -4543,16 +4543,26 @@ 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 's/^[[:space:]]\+//;s/[[:space:]]\+$//' ) - model=$( cat $sys_path/model 2>/dev/null | sed 's/^[[:space:]]\+//;s/[[:space:]]\+$//' ) - rev_number=$( cat $sys_path/rev 2>/dev/null | sed 's/^[[:space:]]\+//;s/[[:space:]]\+$//' ) + vendor=$( cat $sys_path/vendor 2>/dev/null | sed 's/^[[:space:]]\+//;s/[[:space:]]\+$//;s/,//g' ) + model=$( cat $sys_path/model 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' ) fi elif [[ -e /proc/ide/$disk/model ]];then - vendor=$( cat /proc/ide/$disk/model 2>/dev/null | sed 's/^[[:space:]]\+//;s/[[:space:]]\+$//' ) + vendor=$( cat /proc/ide/$disk/model 2>/dev/null | sed 's/^[[:space:]]\+//;s/[[:space:]]\+$//;s/,//g' ) fi if [[ $B_EXTRA_DATA == 'true' ]];then proc_cdrom="$( cat /proc/sys/dev/cdrom/info 2>/dev/null )" - + fi + if [[ -n $vendor ]];then + vendor=$( gawk ' + BEGIN { + IGNORECASE=1 + } + { + gsub(/'"$BAN_LIST_NORMAL"'/, "", $0) + print $0 + }' <<< $vendor + ) fi item_string="$item_string,$vendor,$model,$rev_number"