aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Query.pm
diff options
context:
space:
mode:
Diffstat (limited to 'URPM/Query.pm')
-rw-r--r--URPM/Query.pm15
1 files changed, 7 insertions, 8 deletions
diff --git a/URPM/Query.pm b/URPM/Query.pm
index e207f1d..5b62f11 100644
--- a/URPM/Query.pm
+++ b/URPM/Query.pm
@@ -12,13 +12,13 @@ use strict;
# Return an array of ID tag
sub tag2id {
- my @l = @_;
- my %taglist = URPM::list_rpm_tag();
- map { $taglist{uc($_)} || undef } @l;
+ my @l = @_;
+ my %taglist = URPM::list_rpm_tag();
+ map { $taglist{uc($_)} || undef } @l;
}
sub query_pkg {
- my ($urpm, $pkg, $query) = @_;
+ my (undef, $pkg, $query) = @_;
my @tags = map {
[ $pkg->get_tag(tag2id($_)) ]
} $query =~ m/\%\{([^{}]*)\}*/g;
@@ -29,12 +29,11 @@ sub query_pkg {
my ($max, @res) = 0;
foreach (@tags) { $max < $#{$_} and $max = $#{$_} };
-
+
foreach my $i (0 .. $max) {
- push(@res, sprintf($query, map { ${$_}[ $#{$_} < $i ? $#{$_} : $i ] } @tags));
+ push(@res, sprintf($query, map { ${$_}[ $#{$_} < $i ? $#{$_} : $i ] } @tags));
}
- @res
+ @res
}
-
1;