summaryrefslogtreecommitdiffstats
path: root/urpmf
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-02-26 15:29:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-02-26 15:29:24 +0000
commit893eaf390db6fe358faa8f3012d32a3172adf3c9 (patch)
treecb49fd60c1a24f6834a3d6cd7c5a1724f6d5e05e /urpmf
parent06be295ddf32bf035a1d170485211a6543f597a5 (diff)
downloadurpmi-893eaf390db6fe358faa8f3012d32a3172adf3c9.tar
urpmi-893eaf390db6fe358faa8f3012d32a3172adf3c9.tar.gz
urpmi-893eaf390db6fe358faa8f3012d32a3172adf3c9.tar.bz2
urpmi-893eaf390db6fe358faa8f3012d32a3172adf3c9.tar.xz
urpmi-893eaf390db6fe358faa8f3012d32a3172adf3c9.zip
perl_checker compliance
Diffstat (limited to 'urpmf')
-rwxr-xr-xurpmf15
1 files changed, 7 insertions, 8 deletions
diff --git a/urpmf b/urpmf
index 4605ca39..1487c12f 100755
--- a/urpmf
+++ b/urpmf
@@ -37,6 +37,7 @@ usage: urpmf [options] pattern-expression
") . N(" --env - use specific environment (typically a bug report).
") . N(" --excludemedia - do not use the given media, separated by comma.
") . N(" --literal, -l - don't match patterns, use argument as a literal string.
+") . N(" --urpmi-root - use another root for urpmi db & rpm installation.
") . N(" --media - use only the given media, separated by comma.
") . N(" --sortmedia - sort media according to substrings separated by comma.
") . N(" --synthesis - use the given synthesis instead of urpmi db.
@@ -103,7 +104,8 @@ our $expr; # regexp to match against
our %uniq;
#- parse arguments list.
-urpm::args::parse_cmdline() or exit(1);
+my $urpm = new urpm;
+urpm::args::parse_cmdline(urpm => $urpm) or exit(1);
if ($qf eq '%default') {
#- nothing on the command-line : default is to search on file names
@@ -116,7 +118,6 @@ if ($qf eq '%default') {
#- replace first %name by %fullname if -f was specified
if ($full) { $qf =~ s/%name\b/%fullname/ }
-my $urpm = new urpm;
$verbose or $urpm->{log} = sub {};
my $multitag = '';
@@ -190,7 +191,7 @@ if ($env) {
$urpm->{statedir} = $env;
}
-my $lock = urpm::lock::urpmi_db($urpm, '', 'nofatal');
+my $_lock = urpm::lock::urpmi_db($urpm, '', 'nofatal');
my $need_hdlist = grep { $usedtags{$_} } qw(
buildhost
buildtime
@@ -206,6 +207,7 @@ my $need_hdlist = grep { $usedtags{$_} } qw(
urpm::media::configure($urpm,
nocheck_access => 1,
no_skiplist => 1,
+ no_second_pass => 1,
media => $media,
excludemedia => $excludemedia,
sortmedia => $sortmedia,
@@ -216,11 +218,8 @@ urpm::media::configure($urpm,
);
if ($need_hdlist) {
- # @hdmedia is the list of all media searched that use hdlists
- my @hdmedia = grep {
- !$_->{synthesis} && !$_->{removable} && !$_->{ignore};
- } @{ $urpm->{media} };
- if (!@hdmedia) {
+ my @hdlist_media = grep { !$_->{ignore} && -e urpm::media::any_hdlist($urpm, $_) } @{$urpm->{media}};
+ if (!@hdlist_media) {
print N("Note: since no media searched uses hdlists, urpmf was unable to return any result\n");
print N("You may want to use --name to search for package names.\n") if !$usedtags{name};
}