summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-06-30 17:27:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-06-30 17:27:57 +0000
commit24558d3592895c919ac75cae6fb83e16bd9397a6 (patch)
tree873a6f7353a9c94aa652d80c21838d2d47cbccba
parenta3ef7423c5d8670da2c1c254383d33eb0f3a36e0 (diff)
downloadurpmi-24558d3592895c919ac75cae6fb83e16bd9397a6.tar
urpmi-24558d3592895c919ac75cae6fb83e16bd9397a6.tar.gz
urpmi-24558d3592895c919ac75cae6fb83e16bd9397a6.tar.bz2
urpmi-24558d3592895c919ac75cae6fb83e16bd9397a6.tar.xz
urpmi-24558d3592895c919ac75cae6fb83e16bd9397a6.zip
enhance rpm-find-leaves to handle versions in require/provides
-rw-r--r--rpm-find-leaves10
1 files changed, 8 insertions, 2 deletions
diff --git a/rpm-find-leaves b/rpm-find-leaves
index f41c0a26..b257d25f 100644
--- a/rpm-find-leaves
+++ b/rpm-find-leaves
@@ -53,11 +53,17 @@ my %provides;
foreach my $pkg (@packages) {
next if $options{restrict_group} && $pkg->group !~ /\Q$options{group}/oi;
$l{$pkg->name} = $pkg;
- push @{$provides{$_}}, $pkg->name foreach $pkg->provides_nosense;
+ push @{$provides{$_}}, $pkg foreach $pkg->provides_nosense;
}
foreach my $pkg (@packages) {
- delete @l{grep { $_ ne $pkg->name } @{$provides{$_} || []}} foreach $pkg->requires_nosense;
+ foreach my $prop ($pkg->requires) {
+ my ($n, $s) = URPM::property2name_range($prop);
+ foreach my $p (@{$provides{$n} || []}) {
+ $p != $pkg && $p->provides_overlap($prop) and
+ delete $l{$p->name};
+ }
+ }
}
if ($options{fullname}) {