aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-02-07 21:19:59 +0000
committerThierry Vignaud <tv@mageia.org>2012-02-07 21:19:59 +0000
commit42e10608a8d323923cc7c21ab611a55639fadaed (patch)
tree6c01de06127f629ac8567c677bc1d3ae0754bdcd
parent3d3ba0584b98eda457bcb2c59561d87a071de084 (diff)
downloadperl-URPM-42e10608a8d323923cc7c21ab611a55639fadaed.tar
perl-URPM-42e10608a8d323923cc7c21ab611a55639fadaed.tar.gz
perl-URPM-42e10608a8d323923cc7c21ab611a55639fadaed.tar.bz2
perl-URPM-42e10608a8d323923cc7c21ab611a55639fadaed.tar.xz
perl-URPM-42e10608a8d323923cc7c21ab611a55639fadaed.zip
(_selected_size_filesize) fix computing size of added/freed disk space
when updating involves removing some packages (mga#4427) (bug introduced by fpons in r11176 on Jun 26 2003 ("0.91-7mdk"))
-rw-r--r--NEWS2
-rw-r--r--URPM/Resolve.pm6
2 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 13ac4fb..40eefd6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- cleanups
+- fix computing size of added/freed disk space when updating involves removing
+ some packages (mga#4427)
Version 3.38.6 - 15 January 2012
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 12b4a01..494cb11 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -1541,7 +1541,11 @@ sub _selected_size_filesize {
foreach (values %{$state->{rejected} || {}}) {
$_->{removed} || $_->{obsoleted} or next;
- $size -= $_->{size};
+ if ($_->{size} < 0) {
+ $size += $_->{size};
+ } else {
+ $size -= $_->{size};
+ }
}
foreach (@{$state->{orphans_to_remove} || []}) {