summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-05-16 09:06:36 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-05-16 09:06:36 +0000
commit607f3e01270443e0ff6097a4e6fe46aec01ace34 (patch)
tree52c010a4eb834feef9021a56eeca2ace1e7c4c46
parent4533c41ea1d052c4df901a81201876283ced9315 (diff)
downloadurpmi-607f3e01270443e0ff6097a4e6fe46aec01ace34.tar
urpmi-607f3e01270443e0ff6097a4e6fe46aec01ace34.tar.gz
urpmi-607f3e01270443e0ff6097a4e6fe46aec01ace34.tar.bz2
urpmi-607f3e01270443e0ff6097a4e6fe46aec01ace34.tar.xz
urpmi-607f3e01270443e0ff6097a4e6fe46aec01ace34.zip
Small optimisation
-rw-r--r--rpm-find-leaves15
1 files changed, 8 insertions, 7 deletions
diff --git a/rpm-find-leaves b/rpm-find-leaves
index 6d32dfe2..978e8904 100644
--- a/rpm-find-leaves
+++ b/rpm-find-leaves
@@ -5,10 +5,11 @@ use strict;
use urpm;
use urpm::msg;
-my %options;
-$options{restrict_group} = 0;
-$options{group} = 'System/Libraries';
-$options{root} = '';
+my %options = {
+ restrict_group => 0,
+ group => 'System/Libraries',
+ root => '',
+};
my $usage = N("usage: %s [options]
where [options] are from
@@ -19,13 +20,13 @@ where [options] are from
", $options{group});
while ($_ = shift) {
- /^--root$/ and do {
+ $_ eq '--root' and do {
my $root = shift;
$root and $options{root} = $root;
next;
};
- /^-g$/ and do {
+ $_ eq '-g' and do {
$options{restrict_group} = 1;
my $group = shift;
$group and $options{group} = $group;
@@ -47,7 +48,7 @@ my @packages;
my %l;
my %provides;
foreach my $pkg (@packages) {
- next if $options{restrict_group} && $pkg->group !~ /$options{group}/i;
+ next if $options{restrict_group} && $pkg->group !~ /$options{group}/oi;
$l{$pkg->name} = 1;
push @{$provides{$_}}, $pkg->name foreach $pkg->provides_nosense;
}