diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-11-14 15:14:00 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-11-14 15:14:00 +0000 |
commit | 830d5819dd6280d8133342d700a26b4f6ee9ec56 (patch) | |
tree | 785973af01ee18d57619009c54bf209ad616a133 /urpm/select.pm | |
parent | e288867b461c26c3d9de1f258d50cb7cf72a26d7 (diff) | |
download | urpmi-830d5819dd6280d8133342d700a26b4f6ee9ec56.tar urpmi-830d5819dd6280d8133342d700a26b4f6ee9ec56.tar.gz urpmi-830d5819dd6280d8133342d700a26b4f6ee9ec56.tar.bz2 urpmi-830d5819dd6280d8133342d700a26b4f6ee9ec56.tar.xz urpmi-830d5819dd6280d8133342d700a26b4f6ee9ec56.zip |
- urpmi
o in --auto, do not allow to install a package substring match
(you can use -a to force it)
Diffstat (limited to 'urpm/select.pm')
-rw-r--r-- | urpm/select.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/urpm/select.pm b/urpm/select.pm index f816bbb7..11a2823e 100644 --- a/urpm/select.pm +++ b/urpm/select.pm @@ -79,6 +79,7 @@ sub build_listid_ { #- all #- caseinsensitive #- fuzzy +#- no_substring #- src #- use_provides #- @@ -166,7 +167,11 @@ sub _search_packages { my $pkg = $urpm->{depslist}[$_]; push @{$l{$pkg->name}}, $pkg; } - if (values(%l) == 0 || values(%l) > 1 && !$options{all}) { + #- non-exact match? + my $is_substring_match = !@{$exact_a{$v} || $exact_ra{$v} || []}; + + if (values(%l) == 0 + || !$options{all} && (values(%l) > 1 || $is_substring_match && $options{no_substring})) { $urpm->{error}(N("No package named %s", $v)); values(%l) != 0 and $urpm->{error}( N("The following packages contain %s: %s", @@ -175,10 +180,8 @@ sub _search_packages { ); $result = 0; } else { - if (!@{$exact_a{$v} || $exact_ra{$v} || []}) { - #- we found a non-exact match - $result = 'substring'; - } + $is_substring_match and $result = 'substring'; + $name2ids{$v} = join('|', map { my $best; foreach (@$_) { |