diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-11-28 16:21:34 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-11-28 16:21:34 +0000 |
commit | a92810cd4d3d5c78b4de512dfae62ba437402c0a (patch) | |
tree | d0330aed13408015c299f507cf57fd64ecc11723 | |
parent | a262316adcbea290d2ad81eb071714dc81d22006 (diff) | |
download | urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar.gz urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar.bz2 urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar.xz urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.zip |
factorize code
-rwxr-xr-x | urpmq | 28 |
1 files changed, 12 insertions, 16 deletions
@@ -205,28 +205,24 @@ if ($options{list_aliases}) { } else { %requested = $urpm->register_rpms(@files); - #- search the packages according to the selection given by the user. - if (@names) { + my $search_packages = sub { + my ($names, %more_options) = @_; + urpm::select::search_packages($urpm, - \%requested, - [ @names ], + \%requested, $names, use_provides => $options{use_provides}, fuzzy => $urpm->{options}{fuzzy}, caseinsensitive => $options{caseinsensitive}, - all => $options{all}, - ) or $options{force} - or exit 1; + %more_options, + ); + }; + + #- search the packages according to the selection given by the user. + if (@names) { + $search_packages->(\@names, all => $options{all}) or $options{force} or exit 1; } if (@src_names) { - urpm::select::search_packages($urpm, - \%requested, - [ @src_names ], - use_provides => $options{use_provides}, - fuzzy => $urpm->{options}{fuzzy}, - caseinsensitive => $options{caseinsensitive}, - src => 1, - ) or $options{force} - or exit 1; + $search_packages->(\@src_names, src => 1) or $options{force} or exit 1; } #- keep track of choices, don't propagate but mark them selected. |