summaryrefslogtreecommitdiffstats
path: root/urpmq
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-11-28 16:21:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-11-28 16:21:34 +0000
commita92810cd4d3d5c78b4de512dfae62ba437402c0a (patch)
treed0330aed13408015c299f507cf57fd64ecc11723 /urpmq
parenta262316adcbea290d2ad81eb071714dc81d22006 (diff)
downloadurpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar
urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar.gz
urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar.bz2
urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.tar.xz
urpmi-a92810cd4d3d5c78b4de512dfae62ba437402c0a.zip
factorize code
Diffstat (limited to 'urpmq')
-rwxr-xr-xurpmq28
1 files changed, 12 insertions, 16 deletions
diff --git a/urpmq b/urpmq
index e0c2159a..0c6fe0cf 100755
--- a/urpmq
+++ b/urpmq
@@ -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.