patch 5, more fixes

This commit is contained in:
inxi-svn 2011-06-18 00:52:38 +00:00
parent 8d89081fe4
commit e9372be01e

22
inxi
View file

@ -480,7 +480,7 @@ DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release"
# $'\1' gets weird results : # $'\1' gets weird results :
# user@host $ ARR=($'\x01'"one two" three four); echo ${ARR[0]} | hd -v # 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.| # 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. ltd $'\2'"\<inc\>" intl. inc. $'\2'\<co\> 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. ltd $'\2'"\<inc\>" intl. inc. $'\2'\<co\> 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]" ) 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: # after processing, the ban arrays will be put into these:
BAN_LIST_NORMAL='' 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||" ) 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 # no need to test for errors yet, probably other user systems will require some alternate paths though
if [[ -n $sys_path ]];then if [[ -n $sys_path ]];then
vendor=$( cat $sys_path/vendor 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:]]\+$//' ) 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:]]\+$//' ) rev_number=$( cat $sys_path/rev 2>/dev/null | sed 's/^[[:space:]]\+//;s/[[:space:]]\+$//;s/,//g' )
fi fi
elif [[ -e /proc/ide/$disk/model ]];then 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 fi
if [[ $B_EXTRA_DATA == 'true' ]];then if [[ $B_EXTRA_DATA == 'true' ]];then
proc_cdrom="$( cat /proc/sys/dev/cdrom/info 2>/dev/null )" 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 fi
item_string="$item_string,$vendor,$model,$rev_number" item_string="$item_string,$vendor,$model,$rev_number"