diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-25 20:43:07 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-25 20:43:07 +0000 |
commit | f3dd5972ec4f943f0b3a0e5504aa9cefa3a7c561 (patch) | |
tree | 2bff40fa29bca03aae18dc485d44de21fbbabad7 /URPM/Resolve.pm | |
parent | 6b75bf9915b11b9066ba7ca0356d25bfabe1b12c (diff) | |
download | perl-URPM-f3dd5972ec4f943f0b3a0e5504aa9cefa3a7c561.tar perl-URPM-f3dd5972ec4f943f0b3a0e5504aa9cefa3a7c561.tar.gz perl-URPM-f3dd5972ec4f943f0b3a0e5504aa9cefa3a7c561.tar.bz2 perl-URPM-f3dd5972ec4f943f0b3a0e5504aa9cefa3a7c561.tar.xz perl-URPM-f3dd5972ec4f943f0b3a0e5504aa9cefa3a7c561.zip |
- add filesize to synthesis, add ->filesize to get it, and add
selected_size_filesize() to compute the sum
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r-- | URPM/Resolve.pm | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index bc6da6b..3619c62 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1373,11 +1373,30 @@ sub disable_selected_and_unrequested_dependencies { #- side-effects: none sub selected_size { my ($urpm, $state) = @_; - my $size; + my ($size) = _selected_size_filesize($urpm, $state, 0); + $size; +} +#- side-effects: none +sub selected_size_filesize { + my ($urpm, $state) = @_; + _selected_size_filesize($urpm, $state, 1); +} +#- side-effects: none +sub _selected_size_filesize { + my ($urpm, $state, $compute_filesize) = @_; + my ($size, $filesize, $bad_filesize); foreach (keys %{$state->{selected} || {}}) { my $pkg = $urpm->{depslist}[$_]; $size += $pkg->size; + $compute_filesize or next; + + if (my $n = $pkg->filesize) { + $filesize += $n; + } elsif (!$bad_filesize) { + $urpm->{debug} and $urpm->{debug}("no filesize for package " . $pkg->fullname); + $bad_filesize = 1; + } } foreach (values %{$state->{rejected} || {}}) { @@ -1385,7 +1404,7 @@ sub selected_size { $size -= $_->{size}; } - $size; + $size, $bad_filesize ? 0 : $filesize; } #- compute installed flags for all packages in depslist. |