summaryrefslogtreecommitdiffstats
path: root/rpm-find-leaves
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-07-23 18:25:42 +0000
committerFrancois Pons <fpons@mandriva.com>2002-07-23 18:25:42 +0000
commitd7a2c64f600aac4c2b504cb12fe00280af58ce53 (patch)
tree15b086b1c69bb47b3710bbdd28c5fe729cfec089 /rpm-find-leaves
parent8598875c5afcaef8d468ec31e3ad99abd081a414 (diff)
downloadurpmi-d7a2c64f600aac4c2b504cb12fe00280af58ce53.tar
urpmi-d7a2c64f600aac4c2b504cb12fe00280af58ce53.tar.gz
urpmi-d7a2c64f600aac4c2b504cb12fe00280af58ce53.tar.bz2
urpmi-d7a2c64f600aac4c2b504cb12fe00280af58ce53.tar.xz
urpmi-d7a2c64f600aac4c2b504cb12fe00280af58ce53.zip
3.9-2mdk
Diffstat (limited to 'rpm-find-leaves')
-rw-r--r--rpm-find-leaves23
1 files changed, 13 insertions, 10 deletions
diff --git a/rpm-find-leaves b/rpm-find-leaves
index 32d9668c..5c7fb496 100644
--- a/rpm-find-leaves
+++ b/rpm-find-leaves
@@ -2,21 +2,24 @@
@ARGV and die "usage: rpm-find-leaves\n";
-use rpmtools;
-
-$db = rpmtools::db_open('');
-rpmtools::db_traverse($db, [ qw(name version release provides requires) ], sub {
- push @packages, $_[0];
-});
-rpmtools::db_close($db);
+use URPM;
+my @packages;
+{
+ my $db = URPM::DB::open;
+ $db->traverse(sub {
+ my ($p) = @_;
+ $p->pack_header;
+ push @packages, $p;
+ });
+}
foreach my $pkg (@packages) {
- $l{$pkg->{name}} = 1;
- push @{$provides{$_}}, $pkg->{name} foreach @{$pkg->{provides} || []};
+ $l{$pkg->name} = 1;
+ push @{$provides{$_}}, $pkg->name foreach $pkg->provides_nosense;
}
foreach my $pkg (@packages) {
- delete @l{grep { $_ ne $pkg->{name} } @{$provides{$_} || []}} foreach @{$pkg->{requires} || []};
+ delete @l{grep { $_ ne $pkg->name } @{$provides{$_} || []}} foreach $pkg->requires_nosense;
}
print "$_\n" foreach sort keys %l;