summaryrefslogtreecommitdiffstats
path: root/urpm/select.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-11-16 20:11:43 +0000
committerThierry Vignaud <tv@mageia.org>2012-11-16 20:11:43 +0000
commitba9078ef041c129029a99aa689cc873e2de0b8ca (patch)
tree75fdecf30b7f2f2d2fbe111e36f87acf116a273b /urpm/select.pm
parent821b7ee30c712f8ffa3bfc38eeaf8e99be786fa3 (diff)
downloadurpmi-ba9078ef041c129029a99aa689cc873e2de0b8ca.tar
urpmi-ba9078ef041c129029a99aa689cc873e2de0b8ca.tar.gz
urpmi-ba9078ef041c129029a99aa689cc873e2de0b8ca.tar.bz2
urpmi-ba9078ef041c129029a99aa689cc873e2de0b8ca.tar.xz
urpmi-ba9078ef041c129029a99aa689cc873e2de0b8ca.zip
(search_packages,_search_packages) further comment
Diffstat (limited to 'urpm/select.pm')
-rw-r--r--urpm/select.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/urpm/select.pm b/urpm/select.pm
index 13f1bf6f..7bd4cc2b 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -94,6 +94,8 @@ sub build_listid_ {
Search packages registered by their names by storing their ids into the $packages hash.
+Returns either 0 (error), 1 (OK) or 'substring' (fuzzy match).
+
Recognized options:
=over
@@ -145,6 +147,7 @@ sub _search_packages {
my @found;
$qv = '(?i)' . $qv if $options{caseinsensitive};
+ # First: try to find an exact match
if (!$options{fuzzy}) {
#- try to search through provides.
my @l = map {
@@ -164,6 +167,7 @@ sub _search_packages {
_findindeps($urpm, \%found, $qv, $v, $options{caseinsensitive}, $options{src});
}
+ # Second pass: try to find a partial match (substring) [slow]
foreach my $id (build_listid_($urpm)) {
my $pkg = $urpm->{depslist}[$id];
($options{src} ? $pkg->arch eq 'src' : $pkg->is_arch_compat) or next;