summaryrefslogtreecommitdiffstats
path: root/rpm-find-leaves
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-08 17:52:47 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-08 17:52:47 +0000
commit6b1d26b44bdc748d2c7feddfea07b870d06341f8 (patch)
tree58f6be28af21ca725e0ac346bba0469796436b81 /rpm-find-leaves
parent5b1cab90afd2f73a5ec6824284e2eb8b9a4a05f3 (diff)
downloadurpmi-6b1d26b44bdc748d2c7feddfea07b870d06341f8.tar
urpmi-6b1d26b44bdc748d2c7feddfea07b870d06341f8.tar.gz
urpmi-6b1d26b44bdc748d2c7feddfea07b870d06341f8.tar.bz2
urpmi-6b1d26b44bdc748d2c7feddfea07b870d06341f8.tar.xz
urpmi-6b1d26b44bdc748d2c7feddfea07b870d06341f8.zip
Misc fixes in rpm-find-leaves
Diffstat (limited to 'rpm-find-leaves')
-rw-r--r--rpm-find-leaves9
1 files changed, 5 insertions, 4 deletions
diff --git a/rpm-find-leaves b/rpm-find-leaves
index bc027f66..765d0eaa 100644
--- a/rpm-find-leaves
+++ b/rpm-find-leaves
@@ -15,8 +15,8 @@ my $usage = N("usage: %s [options]
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 given group.
-") . N(" defaults is %s.
+") . N(" -g [group] - restrict results to specified group.
+") . N(" defaults to %s.
", $options{group});
while ($_ = shift) {
@@ -28,8 +28,9 @@ while ($_ = shift) {
};
$_ eq '-g' and do {
$options{restrict_group} = 1;
+ next if !@ARGV || $ARGV[0] =~ /^-/;
my $group = shift;
- $group and $options{group} = $group;
+ $options{group} = $group;
next;
};
print $usage; exit 0;
@@ -48,7 +49,7 @@ my @packages;
my %l;
my %provides;
foreach my $pkg (@packages) {
- next if $options{restrict_group} && $pkg->group !~ /$options{group}/oi;
+ next if $options{restrict_group} && $pkg->group !~ /\Q$options{group}/oi;
$l{$pkg->name} = 1;
push @{$provides{$_}}, $pkg->name foreach $pkg->provides_nosense;
}