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, 7 insertions, 15 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index e0eaf9d..f79c438 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, 1)
+ !$urpm->{provides}{$name}{$_} || $pkg->provides_overlap($property)
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
- if (@chosen == 1) { return \@chosen }
+ return \@chosen if @chosen == 1;
#- 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, 1) and next REQUIRES;
+ !$urpm->{provides}{$n}{$_} || $p->provides_overlap($prop) 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, 1) and ++$satisfied;
+ URPM::ranges_overlap($ps, $s) and ++$satisfied;
}
}
});
@@ -1487,9 +1487,7 @@ sub disable_selected_and_unrequested_dependencies {
#- keep in the packages that had to be unselected.
@all_unselected or push @all_unselected, @unselected;
- if ($urpm->{keep_unrequested_dependencies}) {
- last;
- }
+ last if $urpm->{keep_unrequested_dependencies};
#- search for unrequested required packages.
foreach (@unselected) {
@@ -1554,11 +1552,7 @@ sub _selected_size_filesize {
foreach (values %{$state->{rejected} || {}}) {
$_->{removed} || $_->{obsoleted} or next;
- if ($_->{size} < 0) {
- $size += $_->{size};
- } else {
- $size -= $_->{size};
- }
+ $size -= abs($_->{size});
}
foreach (@{$state->{orphans_to_remove} || []}) {
@@ -1649,9 +1643,7 @@ 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