summaryrefslogtreecommitdiffstats
path: root/rpm-find-leaves
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-07-11 11:55:52 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-07-11 11:55:52 +0000
commit2ca8ba2edfd5aba60def63730113de0ed05d6ef5 (patch)
tree257ed626b81064c93faeabe14738125d4c914fc4 /rpm-find-leaves
parentd6c6b6c10b2b1b58454042deccd3493b015c6feb (diff)
downloadurpmi-2ca8ba2edfd5aba60def63730113de0ed05d6ef5.tar
urpmi-2ca8ba2edfd5aba60def63730113de0ed05d6ef5.tar.gz
urpmi-2ca8ba2edfd5aba60def63730113de0ed05d6ef5.tar.bz2
urpmi-2ca8ba2edfd5aba60def63730113de0ed05d6ef5.tar.xz
urpmi-2ca8ba2edfd5aba60def63730113de0ed05d6ef5.zip
Add an -f option to rpm-find-leaves (show fullnames)
Diffstat (limited to 'rpm-find-leaves')
-rw-r--r--rpm-find-leaves13
1 files changed, 11 insertions, 2 deletions
diff --git a/rpm-find-leaves b/rpm-find-leaves
index 765d0eaa..6af1ef3e 100644
--- a/rpm-find-leaves
+++ b/rpm-find-leaves
@@ -16,6 +16,7 @@ where [options] are from
", $0) . N(" -h|--help - print this help message.
") . N(" --root <path> - use the given root instead of /
") . N(" -g [group] - restrict results to specified group.
+") . N(" -f - output rpm full name (NVRA)
") . N(" defaults to %s.
", $options{group});
@@ -33,6 +34,7 @@ while ($_ = shift) {
$options{group} = $group;
next;
};
+ $_ eq '-f' and do { $options{fullname} = 1; next };
print $usage; exit 0;
}
@@ -50,7 +52,7 @@ my %l;
my %provides;
foreach my $pkg (@packages) {
next if $options{restrict_group} && $pkg->group !~ /\Q$options{group}/oi;
- $l{$pkg->name} = 1;
+ $l{$pkg->name} = $pkg;
push @{$provides{$_}}, $pkg->name foreach $pkg->provides_nosense;
}
@@ -58,4 +60,11 @@ foreach my $pkg (@packages) {
delete @l{grep { $_ ne $pkg->name } @{$provides{$_} || []}} foreach $pkg->requires_nosense;
}
-print "$_\n" foreach sort keys %l;
+if ($options{fullname}) {
+ foreach my $k (sort keys %l) {
+ my $l = $l{$k};
+ print $l->name, '-', $l->version, '-', $l->release, '.', $l->arch, "\n";
+ }
+} else {
+ print "$_\n" foreach sort keys %l;
+}