From 11c6dd5ec517b539234cb183f804f7b5893cbba7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 4 Jul 2008 13:04:31 +0000 Subject: - handle $state->{orphans_to_remove} in selected_size() and build_transaction_set() --- NEWS | 2 ++ URPM.pm | 2 ++ URPM/Resolve.pm | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 51d2efc..f3b6599 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ - add traverse_tag_find() +- handle $state->{orphans_to_remove} in selected_size() and + build_transaction_set() Version 3.16 - 26 June 2008, by Pascal "Pixel" Rigaux diff --git a/URPM.pm b/URPM.pm index 63f7de2..6d237fd 100644 --- a/URPM.pm +++ b/URPM.pm @@ -840,6 +840,8 @@ B: { fullname => { }, } } +B: [ pkg ] + B: { name => { id => undef } } # reversed requires_nosense for selected packages diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index ecc27fb..34ac590 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1434,6 +1434,10 @@ sub _selected_size_filesize { $size -= $_->{size}; } + foreach (@{$state->{orphans_to_remove} || []}) { + $size -= $_->size; + } + $size, $bad_filesize ? 0 : $filesize; } @@ -1876,6 +1880,11 @@ sub build_transaction_set { }; } + if ($state->{orphans_to_remove}) { + my @l = map { scalar $_->fullname } @{$state->{orphans_to_remove}}; + push @{$state->{transaction}}, { remove => \@l }; + } + $state->{transaction}; } -- cgit v1.2.1