equal
deleted
inserted
replaced
80 sub purge_unused { |
80 sub purge_unused { |
81 my ($dir, %block) = @_; |
81 my ($dir, %block) = @_; |
82 |
82 |
83 my ($total, $done); |
83 my ($total, $done); |
84 verbose("# pass 1 - checking for unused blocks"); |
84 verbose("# pass 1 - checking for unused blocks"); |
85 verbose("# estimating file count"); |
85 verbose("# pass 1 - estimating file count"); |
86 |
86 |
87 # calculate the number of files we expect |
87 # calculate the number of files we expect |
88 find(sub { |
88 find(sub { |
89 -d or return; |
89 -d or return; |
90 opendir(my $dh => $_); |
90 opendir(my $dh => $_); |
155 my ($dir, %block) = @_; |
155 my ($dir, %block) = @_; |
156 |
156 |
157 my $total = grep { $_ ne "" } keys(%block); |
157 my $total = grep { $_ ne "" } keys(%block); |
158 my $done = 0; |
158 my $done = 0; |
159 |
159 |
160 verbose("# pass 2 - check image completness"); |
160 verbose("# pass 2 - checking image completeness"); |
161 |
161 |
162 # progress |
162 # progress |
163 local $SIG{ALRM} = sub { |
163 local $SIG{ALRM} = sub { |
164 return alarm 1 if not $done; |
164 return alarm 1 if not $done; |
165 my $speed = $done / (time - $^T + 1); |
165 my $speed = $done / (time - $^T + 1); |