aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-07-24 12:36:52 +0000
committerFrancois Pons <fpons@mandriva.com>2002-07-24 12:36:52 +0000
commit4cf5682cf59a7547e263b74b744515597aec873e (patch)
tree09e915d7844aa63aa26b7814ec0fe8c2d834e14d /URPM
parent9a3a55e34e01d4dba1eb5a09ba25eb3c59101173 (diff)
downloadperl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar.gz
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar.bz2
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar.xz
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.zip
0.50-4mdk
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Build.pm10
-rw-r--r--URPM/Resolve.pm17
2 files changed, 8 insertions, 19 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm
index e3029f7..2c1a592 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -75,19 +75,13 @@ sub parse_rpms_build_headers {
@headers;
}
-#- check if rereading of hdlist is neccessary.
+#- allow rereading of hdlist and clean.
sub unresolved_provides_clean {
my ($urpm) = @_;
- my @unresolved = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
+ my @potentially_unresolved = keys %{$urpm->{provides} || {}};
- #- names can be safely removed in any cases.
- delete $urpm->{names};
-
- #- remove
@{$urpm}{qw(depslist provides)} = ([], {});
@{$urpm->{provides}}{@unresolved} = ();
-
- @unresolved;
}
#- read a list of headers (typically when building an hdlist when provides have
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 5cd8392..52075e8 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -285,6 +285,7 @@ sub resolve_requested {
my $best = join '|', map { $_->id }
grep { $urpm->unsatisfied_requires($db, $state, $_, name => $n) == 0 }
@{$packages->{$p->name}};
+
if ($best) {
push @properties, $best;
} else {
@@ -325,18 +326,12 @@ sub resolve_requested {
#- the existing package will conflicts with selection, check if a newer
#- version will be ok, else ask to remove the old.
my $packages = $urpm->find_candidate_packages($p->name);
- my $best;
- foreach (@{$packages->{$p->name}}) {
- unless (grep { ranges_overlap($_, $property) } $_->provides) {
- if ($best && $best != $_) {
- $_->compare_pkg($best) > 0 and $best = $_;
- } else {
- $best = $_;
- }
- }
- }
+ my $best = join '|', map { $_->id }
+ grep { ! grep { ranges_overlap($_, $property) } $_->provides }
+ @{$packages->{$p->name}};
+
if ($best) {
- push @properties, $best->id;
+ push @properties, $best;
} else {
#- no package have been found, we need to remove the package examined.
$options{keep_state} or