mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
added more robust array clearing
This commit is contained in:
parent
7dcc1e16a2
commit
ca4e5e1c1e
70
inxi
70
inxi
|
@ -625,11 +625,13 @@ DISTROS_OS_RELEASE_GOOD="arch-release SuSE-release "
|
||||||
## OUTPUT FILTERS/SEARCH ##
|
## OUTPUT FILTERS/SEARCH ##
|
||||||
# Note that \<ltd\> bans only words, not parts of strings; in \<corp\> you can't use punctuation characters like . or ,
|
# Note that \<ltd\> bans only words, not parts of strings; in \<corp\> you can't use punctuation characters like . or ,
|
||||||
# we're saving about 10+% of the total script exec time by hand building the ban lists here, using hard quotes.
|
# we're saving about 10+% of the total script exec time by hand building the ban lists here, using hard quotes.
|
||||||
|
|
||||||
|
BAN_LIST_NORMAL='chipset|components|computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|incorporation|industrial|international|nee|revision|semiconductor|software|technologies|technology|ltd\.|\<ltd\>|inc\.|\<inc\>|intl\.|co\.|\<co\>|corp\.|\<corp\>|\(tm\)|\(r\)|®|\(rev ..\)'
|
||||||
|
BAN_LIST_CPU='@||cpu |cpu deca|dual core|dual-core|tri core|tri-core|quad core|quad-core|ennea|genuine|hepta|hexa|multi|octa|penta|processor|single|triple|[0-9\.]+ *[MmGg][Hh][Zz]'
|
||||||
# See github issue 75 for more details on value: *, triggers weird behaviors if present in value
|
# See github issue 75 for more details on value: *, triggers weird behaviors if present in value
|
||||||
# /sys/devices/virtual/dmi/id/product_name:['*']
|
# /sys/devices/virtual/dmi/id/product_name:['*']
|
||||||
# this is for bash arrays AND avoiding * in arrays: ( fred * greg ) expands to the contents of the directory
|
# this is for bash arrays AND avoiding * in arrays: ( fred * greg ) expands to the contents of the directory
|
||||||
BAN_LIST_NORMAL='chipset|components|computing|computer|corporation|communications|electronics|electrical|electric|gmbh|group|incorporation|industrial|international|nee|revision|semiconductor|software|technologies|technology|ltd\.|\<ltd\>|inc\.|\<inc\>|intl\.|co\.|\<co\>|corp\.|\<corp\>|\(tm\)|\(r\)|®|^\*$|\(rev ..\)'
|
BAN_LIST_ARRAY=',|^[[:space:]]*\*[[:space:]]*$'
|
||||||
BAN_LIST_CPU='@||cpu |cpu deca|dual core|dual-core|tri core|tri-core|quad core|quad-core|ennea|genuine|hepta|hexa|multi|octa|penta|processor|single|triple|[0-9\.]+ *[MmGg][Hh][Zz]'
|
|
||||||
|
|
||||||
SENSORS_GPU_SEARCH='intel|radeon|nouveau'
|
SENSORS_GPU_SEARCH='intel|radeon|nouveau'
|
||||||
|
|
||||||
|
@ -3748,7 +3750,7 @@ get_audio_data()
|
||||||
audioCard=gensub(/^[0-9a-f:\.]+ [^:]+: (.+)$/,"\\1","g",$0)
|
audioCard=gensub(/^[0-9a-f:\.]+ [^:]+: (.+)$/,"\\1","g",$0)
|
||||||
# The doublequotes are necessary because of the pipes in the variable.
|
# The doublequotes are necessary because of the pipes in the variable.
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", audioCard)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", audioCard)
|
||||||
gsub(/,/, " ", audioCard)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", audioCard)
|
||||||
gsub(/^ +| +$/, "", audioCard)
|
gsub(/^ +| +$/, "", audioCard)
|
||||||
gsub(/ [ \t]+/, " ", audioCard)
|
gsub(/ [ \t]+/, " ", audioCard)
|
||||||
aPciBusId[audioCard] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
|
aPciBusId[audioCard] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
|
||||||
|
@ -3756,7 +3758,7 @@ get_audio_data()
|
||||||
|
|
||||||
# loop until you get to the end of the data block
|
# loop until you get to the end of the data block
|
||||||
while (getline && !/^$/) {
|
while (getline && !/^$/) {
|
||||||
gsub( /,/, "", $0 )
|
gsub(/'"$BAN_LIST_ARRAY"'/, "", $0 )
|
||||||
if (/driver in use/) {
|
if (/driver in use/) {
|
||||||
drivers[audioCard] = drivers[audioCard] gensub( /(.*): (.*)/ ,"\\2", "g" ,$0 ) ""
|
drivers[audioCard] = drivers[audioCard] gensub( /(.*): (.*)/ ,"\\2", "g" ,$0 ) ""
|
||||||
}
|
}
|
||||||
|
@ -3867,7 +3869,7 @@ get_audio_usb_data()
|
||||||
separator=""
|
separator=""
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
gsub( /,/, " ", $0 )
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0 )
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
||||||
gsub(/ [ \t]+/, " ", $0)
|
gsub(/ [ \t]+/, " ", $0)
|
||||||
for ( i=7; i<= NF; i++ ) {
|
for ( i=7; i<= NF; i++ ) {
|
||||||
|
@ -3915,8 +3917,8 @@ get_audio_alsa_data()
|
||||||
# some alsa strings have the build date in (...)
|
# some alsa strings have the build date in (...)
|
||||||
# remove trailing . and remove possible second line if compiled by user
|
# remove trailing . and remove possible second line if compiled by user
|
||||||
$0 !~ /compile/ {
|
$0 !~ /compile/ {
|
||||||
gsub( /Driver | [(].*[)]|\.$/,"",$0 )
|
gsub(/Driver | [(].*[)]|\.$/,"",$0 )
|
||||||
gsub(/,/, " ", $0)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
|
||||||
gsub(/^ +| +$/, "", $0)
|
gsub(/^ +| +$/, "", $0)
|
||||||
gsub(/ [ \t]+/, " ", $0)
|
gsub(/ [ \t]+/, " ", $0)
|
||||||
sub(/Advanced Linux Sound Architecture/, "ALSA", $0)
|
sub(/Advanced Linux Sound Architecture/, "ALSA", $0)
|
||||||
|
@ -4075,7 +4077,7 @@ get_cpu_data()
|
||||||
# TAKE NOTE: \t+ will work for $FILE_CPUINFO, but SOME ARBITRARY FILE used for TESTING might contain SPACES!
|
# TAKE NOTE: \t+ will work for $FILE_CPUINFO, but SOME ARBITRARY FILE used for TESTING might contain SPACES!
|
||||||
# Therefore PATCH to use [ \t]+ when TESTING!
|
# Therefore PATCH to use [ \t]+ when TESTING!
|
||||||
/^processor[ \t]+:/ {
|
/^processor[ \t]+:/ {
|
||||||
gsub(/,/, " ", $NF)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
|
||||||
gsub(/^ +| +$/, "", $NF)
|
gsub(/^ +| +$/, "", $NF)
|
||||||
if ( $NF ~ "^[0-9]+$" ) {
|
if ( $NF ~ "^[0-9]+$" ) {
|
||||||
nr = $NF
|
nr = $NF
|
||||||
|
@ -4092,7 +4094,7 @@ get_cpu_data()
|
||||||
/^model name|^cpu\t+:/ {
|
/^model name|^cpu\t+:/ {
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
|
||||||
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
|
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
|
||||||
gsub(/,/, " ", $NF)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
|
||||||
gsub(/^ +| +$/, "", $NF)
|
gsub(/^ +| +$/, "", $NF)
|
||||||
gsub(/ [ \t]+/, " ", $NF)
|
gsub(/ [ \t]+/, " ", $NF)
|
||||||
cpu[nr, "model"] = $NF
|
cpu[nr, "model"] = $NF
|
||||||
|
@ -4242,7 +4244,7 @@ get_cpu_data_bsd()
|
||||||
/^hw.model/ && ( bsdVersion != "darwin" ) {
|
/^hw.model/ && ( bsdVersion != "darwin" ) {
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
|
||||||
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
|
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
|
||||||
gsub(/,/," ",$NF)
|
gsub(/'"$BAN_LIST_ARRAY"'/," ",$NF)
|
||||||
sub(/[a-z]+-core/, "", $NF )
|
sub(/[a-z]+-core/, "", $NF )
|
||||||
gsub(/^ +| +$|\"/, "", $NF)
|
gsub(/^ +| +$|\"/, "", $NF)
|
||||||
gsub(/ [ \t]+/, " ", $NF)
|
gsub(/ [ \t]+/, " ", $NF)
|
||||||
|
@ -4299,7 +4301,7 @@ get_cpu_data_bsd()
|
||||||
/^machdep.cpu.brand_string/ {
|
/^machdep.cpu.brand_string/ {
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF )
|
||||||
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
|
gsub(/'"$BAN_LIST_CPU"'/, "", $NF )
|
||||||
gsub(/,/," ",$NF)
|
gsub(/'"$BAN_LIST_ARRAY"'/," ",$NF)
|
||||||
sub(/[a-z]+-core/, "", $NF )
|
sub(/[a-z]+-core/, "", $NF )
|
||||||
gsub(/^ +| +$|\"/, "", $NF)
|
gsub(/^ +| +$|\"/, "", $NF)
|
||||||
gsub(/ [ \t]+/, " ", $NF)
|
gsub(/ [ \t]+/, " ", $NF)
|
||||||
|
@ -4346,7 +4348,7 @@ get_cpu_flags_bsd()
|
||||||
gsub(/<[a-z0-9]+>/,"", $2)
|
gsub(/<[a-z0-9]+>/,"", $2)
|
||||||
# all the flags are contained within < ... > on freebsd at least
|
# all the flags are contained within < ... > on freebsd at least
|
||||||
gsub(/.*<|>.*/,"", $2)
|
gsub(/.*<|>.*/,"", $2)
|
||||||
gsub(/,/," ", $2)
|
gsub(/'"$BAN_LIST_ARRAY"'/," ", $2)
|
||||||
cpuFlags = cpuFlags " " $2
|
cpuFlags = cpuFlags " " $2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4422,7 +4424,7 @@ get_cpu_ht_multicore_smp_data()
|
||||||
}
|
}
|
||||||
# array of logical processors, both HT and physical
|
# array of logical processors, both HT and physical
|
||||||
/^processor/ {
|
/^processor/ {
|
||||||
gsub(/,/, " ", $NF)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
|
||||||
gsub(/^ +| +$/, "", $NF)
|
gsub(/^ +| +$/, "", $NF)
|
||||||
if ( $NF ~ "^[0-9]+$" ) {
|
if ( $NF ~ "^[0-9]+$" ) {
|
||||||
a_processor_id[proc_iter] = $NF
|
a_processor_id[proc_iter] = $NF
|
||||||
|
@ -5161,7 +5163,7 @@ get_distro_data()
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
gsub(/\\[a-z]/, "")
|
gsub(/\\[a-z]/, "")
|
||||||
gsub(/,/, " ")
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ")
|
||||||
gsub(/^ +| +$/, "")
|
gsub(/^ +| +$/, "")
|
||||||
gsub(/ [ \t]+/, " ")
|
gsub(/ [ \t]+/, " ")
|
||||||
print
|
print
|
||||||
|
@ -5421,7 +5423,7 @@ get_dmidecode_data()
|
||||||
cutExtraTab="true"
|
cutExtraTab="true"
|
||||||
}
|
}
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", twoData)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", twoData)
|
||||||
gsub(/,/, " ", twoData)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", twoData)
|
||||||
# clean out Handle line
|
# clean out Handle line
|
||||||
# sub(/^Handle.*/,"", $0)
|
# sub(/^Handle.*/,"", $0)
|
||||||
sub(/^[[:space:]]*Inactive.*/,"",twoData)
|
sub(/^[[:space:]]*Inactive.*/,"",twoData)
|
||||||
|
@ -5492,7 +5494,7 @@ get_dmesg_boot_data()
|
||||||
dmsg_boot_data="$( cat $FILE_DMESG_BOOT 2>/dev/null | gawk '
|
dmsg_boot_data="$( cat $FILE_DMESG_BOOT 2>/dev/null | gawk '
|
||||||
{
|
{
|
||||||
sub(/[[:space:]]*=[[:space:]]*|:[[:space:]]*/,":", $0)
|
sub(/[[:space:]]*=[[:space:]]*|:[[:space:]]*/,":", $0)
|
||||||
gsub(/,/," ", $0)
|
gsub(/'"$BAN_LIST_ARRAY"'/," ", $0)
|
||||||
gsub(/\"/, "", $0)
|
gsub(/\"/, "", $0)
|
||||||
gsub(/[[:space:]][[:space:]]/, " ", $0)
|
gsub(/[[:space:]][[:space:]]/, " ", $0)
|
||||||
print $0
|
print $0
|
||||||
|
@ -5669,7 +5671,7 @@ get_graphics_card_data()
|
||||||
# card. .1 would be for example: Display Adapter with bus id x:xx.1, not the right one
|
# card. .1 would be for example: Display Adapter with bus id x:xx.1, not the right one
|
||||||
/vga compatible controller|3D controller|Display controller/ {
|
/vga compatible controller|3D controller|Display controller/ {
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF)
|
||||||
gsub(/,/, " ", $NF)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $NF)
|
||||||
gsub(/^ +| +$/, "", $NF)
|
gsub(/^ +| +$/, "", $NF)
|
||||||
gsub(/ [ \t]+/, " ", $NF)
|
gsub(/ [ \t]+/, " ", $NF)
|
||||||
busId=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1","",$1)
|
busId=gensub(/^([0-9a-f:\.]+) (.+)$/,"\\1","",$1)
|
||||||
|
@ -5922,7 +5924,7 @@ get_graphics_display_server_data()
|
||||||
}
|
}
|
||||||
/vendor string/ {
|
/vendor string/ {
|
||||||
gsub(/the|inc|foundation|project|corporation/, "", $2)
|
gsub(/the|inc|foundation|project|corporation/, "", $2)
|
||||||
gsub(/,/, " ", $2)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $2)
|
||||||
gsub(/^ +| +$/, "", $2)
|
gsub(/^ +| +$/, "", $2)
|
||||||
gsub(/ [ \t]+/, " ", $2)
|
gsub(/ [ \t]+/, " ", $2)
|
||||||
vendorString = $2
|
vendorString = $2
|
||||||
|
@ -6147,7 +6149,7 @@ get_hdd_data_basic()
|
||||||
gawk -v hddUsed=$hdd_used '
|
gawk -v hddUsed=$hdd_used '
|
||||||
/([hsv]d[a-z]+|(ada|mmcblk)[0-9]+)$/ {
|
/([hsv]d[a-z]+|(ada|mmcblk)[0-9]+)$/ {
|
||||||
driveSize = $(NF - 1)*1024/1000**3
|
driveSize = $(NF - 1)*1024/1000**3
|
||||||
gsub(/,/, " ", driveSize)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", driveSize)
|
||||||
gsub(/^ +| +$/, "", driveSize)
|
gsub(/^ +| +$/, "", driveSize)
|
||||||
printf( $NF",%.1fGB,,\n", driveSize )
|
printf( $NF",%.1fGB,,\n", driveSize )
|
||||||
}
|
}
|
||||||
|
@ -6252,7 +6254,7 @@ get_hard_drive_data_advanced()
|
||||||
#c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/,"\\1 \\2","g",a[i] )
|
#c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/,"\\1 \\2","g",a[i] )
|
||||||
# the vendor: string is useless, and is a bug, ATA is not a vendor for example
|
# the vendor: string is useless, and is a bug, ATA is not a vendor for example
|
||||||
c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/, "\\2", "g", a[i] )
|
c=gensub( /^ *vendor: (.+) +model: (.+) +rev:.*$/, "\\2", "g", a[i] )
|
||||||
gsub(/,/, " ", c)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", c)
|
||||||
gsub(/^ +| +$/, "", c)
|
gsub(/^ +| +$/, "", c)
|
||||||
gsub(/ [ \t]+/, " ", c)
|
gsub(/ [ \t]+/, " ", c)
|
||||||
#print a[i]
|
#print a[i]
|
||||||
|
@ -6747,7 +6749,7 @@ get_machine_data()
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
||||||
gsub(/,/, " ", $0)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
|
||||||
# yes, there is a typo in a user data set, unknow
|
# yes, there is a typo in a user data set, unknow
|
||||||
# Base Board Version|Base Board Serial Number
|
# Base Board Version|Base Board Serial Number
|
||||||
# Chassis Manufacturer|Chassis Version|Chassis Serial Number
|
# Chassis Manufacturer|Chassis Version|Chassis Serial Number
|
||||||
|
@ -7024,7 +7026,7 @@ get_module_version_number()
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
}
|
}
|
||||||
/^version/ {
|
/^version/ {
|
||||||
gsub(/,/, " ", $2)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $2)
|
||||||
gsub(/^ +| +$/, "", $2)
|
gsub(/^ +| +$/, "", $2)
|
||||||
gsub(/ [ \t]+/, " ", $2)
|
gsub(/ [ \t]+/, " ", $2)
|
||||||
print $2
|
print $2
|
||||||
|
@ -7061,12 +7063,12 @@ get_networking_data()
|
||||||
#gsub(/davicom semiconductor/, "Davicom", aNic[counter])
|
#gsub(/davicom semiconductor/, "Davicom", aNic[counter])
|
||||||
# The doublequotes are necessary because of the pipes in the variable.
|
# The doublequotes are necessary because of the pipes in the variable.
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", aNic[counter])
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", aNic[counter])
|
||||||
gsub(/,/, " ", aNic[counter])
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", aNic[counter])
|
||||||
gsub(/^ +| +$/, "", aNic[counter])
|
gsub(/^ +| +$/, "", aNic[counter])
|
||||||
gsub(/ [ \t]+/, " ", aNic[counter])
|
gsub(/ [ \t]+/, " ", aNic[counter])
|
||||||
aPciBusId[counter] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
|
aPciBusId[counter] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
|
||||||
while ( getline && !/^$/ ) {
|
while ( getline && !/^$/ ) {
|
||||||
gsub(/,/, "", $0)
|
gsub(/'"$BAN_LIST_ARRAY"'/, "", $0)
|
||||||
if ( /^[[:space:]]*I\/O/ ) {
|
if ( /^[[:space:]]*I\/O/ ) {
|
||||||
aPorts[counter] = aPorts[counter] $4 " "
|
aPorts[counter] = aPorts[counter] $4 " "
|
||||||
}
|
}
|
||||||
|
@ -7331,7 +7333,7 @@ get_networking_usb_data()
|
||||||
}
|
}
|
||||||
/'"$USB_NETWORK_SEARCH"'/ && !/bluetooth| hub|keyboard|mouse|printer| ps2|reader|scan|storage/ {
|
/'"$USB_NETWORK_SEARCH"'/ && !/bluetooth| hub|keyboard|mouse|printer| ps2|reader|scan|storage/ {
|
||||||
string=""
|
string=""
|
||||||
gsub( /,/, " ", $0 )
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0 )
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
||||||
gsub(/ [ \t]+/, " ", $0)
|
gsub(/ [ \t]+/, " ", $0)
|
||||||
#sub(/realtek semiconductor/, "Realtek", $0)
|
#sub(/realtek semiconductor/, "Realtek", $0)
|
||||||
|
@ -7466,7 +7468,7 @@ get_networking_local_ip_data()
|
||||||
/^[a-zA-Z]+[0-9]/ {
|
/^[a-zA-Z]+[0-9]/ {
|
||||||
# not clear on why inet is coming through, but this gets rid of it
|
# not clear on why inet is coming through, but this gets rid of it
|
||||||
# as first line item.
|
# as first line item.
|
||||||
gsub(/,/, " ", $0)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
|
||||||
gsub(/^ +| +$/, "", $0)
|
gsub(/^ +| +$/, "", $0)
|
||||||
gsub(/ [ \t]+/, " ", $0)
|
gsub(/ [ \t]+/, " ", $0)
|
||||||
interface = $1
|
interface = $1
|
||||||
|
@ -7650,7 +7652,7 @@ get_optical_drive_data()
|
||||||
{
|
{
|
||||||
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
gsub(/'"$BAN_LIST_NORMAL"'/, "", $0)
|
||||||
sub(/TSSTcorp/, "TSST ", $0) # seen more than one of these weird ones
|
sub(/TSSTcorp/, "TSST ", $0) # seen more than one of these weird ones
|
||||||
gsub(/,/, " ", $0)
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0)
|
||||||
gsub(/^[[:space:]]*|[[:space:]]*$/, "", $0)
|
gsub(/^[[:space:]]*|[[:space:]]*$/, "", $0)
|
||||||
gsub(/ [[:space:]]+/, " ", $0)
|
gsub(/ [[:space:]]+/, " ", $0)
|
||||||
print $0
|
print $0
|
||||||
|
@ -7996,7 +7998,7 @@ get_partition_data()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# for openbsd: /dev/wd0f on /usr type ffs (local, nodev)
|
# for openbsd: /dev/wd0f on /usr type ffs (local, nodev)
|
||||||
gsub( /^.*type[[:space:]]+|[[:space:]]*$/, "", $1 )
|
gsub(/^.*type[[:space:]]+|[[:space:]]*$/, "", $1 )
|
||||||
fileSystem=$1
|
fileSystem=$1
|
||||||
}
|
}
|
||||||
print fileSystem
|
print fileSystem
|
||||||
|
@ -8075,7 +8077,7 @@ get_partition_data_advanced()
|
||||||
partTemp = ""
|
partTemp = ""
|
||||||
}
|
}
|
||||||
# trying to handle space in name
|
# trying to handle space in name
|
||||||
# gsub( /\\040/, " ", $0 )
|
# gsub(/\\040/, " ", $0 )
|
||||||
/[ \t]'$mount_point'[ \t]/ && $1 != "rootfs" {
|
/[ \t]'$mount_point'[ \t]/ && $1 != "rootfs" {
|
||||||
# initialize the variables
|
# initialize the variables
|
||||||
label = ""
|
label = ""
|
||||||
|
@ -8152,7 +8154,7 @@ get_partition_data_advanced()
|
||||||
elif [[ -n $DEV_DISK_LABEL && -n $dev_label ]];then
|
elif [[ -n $DEV_DISK_LABEL && -n $dev_label ]];then
|
||||||
dev_item=$( echo "$DEV_DISK_LABEL" | gawk '
|
dev_item=$( echo "$DEV_DISK_LABEL" | gawk '
|
||||||
# first we need to change space x20 in by-label back to a real space
|
# first we need to change space x20 in by-label back to a real space
|
||||||
#gsub( /x20/, " ", $0 )
|
#gsub(/x20/, " ", $0 )
|
||||||
# then we can see if the string is there
|
# then we can see if the string is there
|
||||||
$0 ~ /[ \t]'$dev_label'[ \t]/ {
|
$0 ~ /[ \t]'$dev_label'[ \t]/ {
|
||||||
item=gensub( /..\/..\/(.+)/, "\\1", 1, $NF )
|
item=gensub( /..\/..\/(.+)/, "\\1", 1, $NF )
|
||||||
|
@ -8671,7 +8673,7 @@ get_raid_data()
|
||||||
uData = ""
|
uData = ""
|
||||||
|
|
||||||
while ( !/^[[:space:]]*$/ ) {
|
while ( !/^[[:space:]]*$/ ) {
|
||||||
gsub(/,/, " ", $0 )
|
gsub(/'"$BAN_LIST_ARRAY"'/, " ", $0 )
|
||||||
gsub(/[[:space:]]+/, " ", $0 )
|
gsub(/[[:space:]]+/, " ", $0 )
|
||||||
if ( $0 ~ /^md/ ) {
|
if ( $0 ~ /^md/ ) {
|
||||||
device = gensub(/(md.*)[[:space:]]?:/, "\\1", "1", $1 )
|
device = gensub(/(md.*)[[:space:]]?:/, "\\1", "1", $1 )
|
||||||
|
@ -9541,7 +9543,7 @@ get_repo_data()
|
||||||
urlData=""
|
urlData=""
|
||||||
repoTitle=""
|
repoTitle=""
|
||||||
}
|
}
|
||||||
gsub( /\[|\]/, "", $1 ) # strip out the brackets
|
gsub(/\[|\]/, "", $1 ) # strip out the brackets
|
||||||
repoTitle = $1 " ~ "
|
repoTitle = $1 " ~ "
|
||||||
}
|
}
|
||||||
/^(mirrorlist|baseurl)/ {
|
/^(mirrorlist|baseurl)/ {
|
||||||
|
@ -9694,7 +9696,7 @@ get_repo_data()
|
||||||
urlData=""
|
urlData=""
|
||||||
repoTitle=""
|
repoTitle=""
|
||||||
}
|
}
|
||||||
gsub( /\[|\]/, "", $1 ) # strip out the brackets
|
gsub(/\[|\]/, "", $1 ) # strip out the brackets
|
||||||
repoTitle = $1 " ~ "
|
repoTitle = $1 " ~ "
|
||||||
}
|
}
|
||||||
/^(sync-uri)/ {
|
/^(sync-uri)/ {
|
||||||
|
@ -9872,7 +9874,7 @@ get_repo_data()
|
||||||
repoUrl=""
|
repoUrl=""
|
||||||
enabled=""
|
enabled=""
|
||||||
while ( getline && $0 !~ /^[[:space:]]*$/ ) {
|
while ( getline && $0 !~ /^[[:space:]]*$/ ) {
|
||||||
gsub(/,/,"",$0)
|
gsub(/'"$BAN_LIST_ARRAY"'/,"",$0)
|
||||||
gsub(/({|}|^[[:space:]]+|[[:space:]]+$)/,"",$1)
|
gsub(/({|}|^[[:space:]]+|[[:space:]]+$)/,"",$1)
|
||||||
gsub(/({|}|^[[:space:]]+|[[:space:]]+$)/,"",$2)
|
gsub(/({|}|^[[:space:]]+|[[:space:]]+$)/,"",$2)
|
||||||
if ( $1 == "url" ) {
|
if ( $1 == "url" ) {
|
||||||
|
|
Loading…
Reference in a new issue