branch one, cleanup

This commit is contained in:
inxi-svn 2014-08-07 22:04:27 +00:00
parent 5ae57ca4cc
commit fcb9adf33a

19
inxi
View file

@ -6333,7 +6333,7 @@ get_networking_data()
A_NETWORK_DATA=( $(
echo "$Lspci_v_Data" | gawk '
# NOTE: see version 2.1.28 or earlier for old logic if for some reason it is needed again
# that used a modified string made from nic name, why, I have no idea, makes no sense and leads
# that used a modified string made from nic name for index, why, I have no idea, makes no sense and leads
# to wrong ordered output as well.
BEGIN {
IGNORECASE=1
@ -6348,12 +6348,7 @@ get_networking_data()
gsub(/,/, " ", aNic[counter])
gsub(/^ +| +$/, "", aNic[counter])
gsub(/ [ \t]+/, " ", aNic[counter])
# NOT USED: construct a unique string ending for each device type detected, this allows for
# multiple instances of the same exact devices, ie, dual gigabit, virtual devices, etc
# nic = counter "*" nic "~~" counter++
aPciBusId[counter] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
# NOT USED: I do not understand why incrementing a string index makes sense?
# eth[nic]++
while ( getline && !/^$/ ) {
gsub(/,/, "", $0)
if ( /^[[:space:]]*I\/O/ ) {
@ -6370,20 +6365,13 @@ get_networking_data()
}
END {
j=0
for (i=0;i<counter;i++) {
useDrivers=""
usePorts=""
useModules=""
useNic=""
usePciBusId=""
# NOT USED: first condition should almost never/never happen
# if ( eth[i] > 1 ) {
# a[j] = eth[i] "x " i
# }
# else {
# a[j] = i
# }
## note: this loses the plural ports case, is it needed anyway?
if ( aPorts[i] != "" ) {
usePorts = aPorts[i]
@ -6401,11 +6389,8 @@ get_networking_data()
usePciBusId = aPciBusId[i]
}
# create array primary item for master array
# NOT USED: and strip out the counter again, this handled dual cards with same chipset
# sub( /~~[0-9]+$/, "", a[j] )
sub( / $/, "", usePorts ) # clean off trailing whitespace
print useNic "," useDrivers "," usePorts "," useModules, "," usePciBusId
# j++
}
}' ) )
IFS="$ORIGINAL_IFS"