aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Resolve.pm
diff options
context:
space:
mode:
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r--URPM/Resolve.pm22
1 files changed, 15 insertions, 7 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index f79c438..e0eaf9d 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -82,7 +82,7 @@ sub find_candidate_packages_ {
$pkg->is_arch_compat or next;
$o_rejected && exists $o_rejected->{$pkg->fullname} and next;
#- check if at least one provide of the package overlap the property.
- !$urpm->{provides}{$name}{$_} || $pkg->provides_overlap($property)
+ !$urpm->{provides}{$name}{$_} || $pkg->provides_overlap($property, 1)
and push @packages, $pkg;
}
}
@@ -287,7 +287,7 @@ sub _find_required_package__sort {
my @chosen = map { $_->[0] } @chosen_with_score;
#- return immediately if there is only one chosen package
- return \@chosen if @chosen == 1;
+ if (@chosen == 1) { return \@chosen }
#- if several packages were selected to match a requested installation,
#- and if --more-choices wasn't given, trim the choices to the first one.
@@ -490,7 +490,7 @@ sub unsatisfied_requires {
#- check on the selected package if a provide is satisfying the resolution (need to do the ops).
foreach (grep { exists $state->{selected}{$_} } keys %{$urpm->{provides}{$n} || {}}) {
my $p = $urpm->{depslist}[$_];
- !$urpm->{provides}{$n}{$_} || $p->provides_overlap($prop) and next REQUIRES;
+ !$urpm->{provides}{$n}{$_} || $p->provides_overlap($prop, 1) and next REQUIRES;
}
#- check if the package itself provides what is necessary.
@@ -513,7 +513,7 @@ sub unsatisfied_requires {
if (my ($pn, $ps) = property2name_range($_)) {
$ps or $state->{cached_installed}{$pn}{$p->fullname} = undef;
$pn eq $n or next;
- URPM::ranges_overlap($ps, $s) and ++$satisfied;
+ URPM::ranges_overlap($ps, $s, 1) and ++$satisfied;
}
}
});
@@ -1487,7 +1487,9 @@ sub disable_selected_and_unrequested_dependencies {
#- keep in the packages that had to be unselected.
@all_unselected or push @all_unselected, @unselected;
- last if $urpm->{keep_unrequested_dependencies};
+ if ($urpm->{keep_unrequested_dependencies}) {
+ last;
+ }
#- search for unrequested required packages.
foreach (@unselected) {
@@ -1552,7 +1554,11 @@ sub _selected_size_filesize {
foreach (values %{$state->{rejected} || {}}) {
$_->{removed} || $_->{obsoleted} or next;
- $size -= abs($_->{size});
+ if ($_->{size} < 0) {
+ $size += $_->{size};
+ } else {
+ $size -= $_->{size};
+ }
}
foreach (@{$state->{orphans_to_remove} || []}) {
@@ -1643,7 +1649,9 @@ sub compute_flags {
sub _choose_best_pkg {
my ($urpm, $pkg_installed, @pkgs) = @_;
- _choose_best_pkg_($urpm, $pkg_installed, grep { $_->compare_pkg($pkg_installed) > 0 } @pkgs);
+ _choose_best_pkg_($urpm, $pkg_installed, grep {
+ $_->compare_pkg($pkg_installed) > 0;
+ } @pkgs);
}
#- side-effects: none