Implement even more accurate space calculation for the BEADM LIST -D option.

This commit is contained in:
Slawomir Wojciech Wojtczak (vermaden) 2012-09-21 14:08:23 +02:00
parent 2a0c48a4a6
commit aefe8c9cf7
1 changed files with 8 additions and 5 deletions

13
beadm
View File

@ -252,7 +252,9 @@ case ${1} in
if(FSNAME ~ /@/) if(FSNAME ~ /@/)
SPACES[FSNAME] = USED SPACES[FSNAME] = USED
else { else {
SPACES[FSNAME] = USEDBYDATASET + USEDBYSNAPSHOTS + USEDREFRESERV SPACES[FSNAME] = USEDBYDATASET + USEDREFRESERV
if(OPTION_D != 1)
SPACES[FSNAME] += USEDBYSNAPSHOTS
BE = " " __get_bename(FSNAME) " " BE = " " __get_bename(FSNAME) " "
if(index(BELIST, BE) == 0) if(index(BELIST, BE) == 0)
BELIST = BELIST " " BE BELIST = BELIST " " BE
@ -338,13 +340,14 @@ case ${1} in
MOUNTPOINT = "-" MOUNTPOINT = "-"
CREATION = __convert_date(CREATIONS[FSNAME]) CREATION = __convert_date(CREATIONS[FSNAME])
} }
SPACE += SPACES[FSNAME]
ORIGIN = ORIGINS[FSNAME] ORIGIN = ORIGINS[FSNAME]
if(ORIGIN != "-") { if(ORIGIN == "-")
SPACE += SPACES[FSNAME]
else {
if(OPTION_D == 1) if(OPTION_D == 1)
SPACE += REFER[ORIGIN] SPACE += REFER[FSNAME]
else else
SPACE += SPACES[ORIGIN] SPACE += SPACES[FSNAME] + SPACES[ORIGIN]
} }
} }
} }