Added support for file system names with 2 or fewer spaces in partition info, fringe cases, but 1.0.0 should be handling most fringe cases

decently well by now.
This commit is contained in:
inxi-svn 2009-02-11 19:29:48 +00:00
parent 9d4a80ba02
commit ea48c34edb

8
inxi
View file

@ -2335,9 +2335,17 @@ get_partition_data()
$NF !~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$|^filesystem/ {
# this is to avoid file systems with spaces in their names, that will make
# the test show the wrong data in each of the fields, if no x%, then do not use
# using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name
if ( $(NF - 1) ~ /[0-9]+\%/ ) {
print $NF "," $(NF - 4) "," $(NF - 3) "," $(NF - 1) ",secondary"
}
# these two cases construct the space containing name
else if ( $(NF - 2) ~ /[0-9]+\%/ ) {
print $(NF - 1) " " $NF "," $(NF - 5) "," $(NF - 4) "," $(NF - 2) ",secondary"
}
else if ( $(NF - 3) ~ /[0-9]+\%/ ) {
print $(NF - 2) " " $(NF - 1) " " $NF "," $(NF - 6) "," $(NF - 5) "," $(NF - 3) ",secondary"
}
}
' )
# now add the swap partition data, doesn't show percent used, someone can figure that in the future