summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-06 17:02:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-06 17:02:01 +0000
commit3b9d01c49e4e49f0c29c3cd990f0419e5cc86f1b (patch)
tree9084f478230255e6c5407fdec957dd527224ac38
parent5cafa126d63abc2a614437a7059a86797b445c1d (diff)
downloadurpmi-3b9d01c49e4e49f0c29c3cd990f0419e5cc86f1b.tar
urpmi-3b9d01c49e4e49f0c29c3cd990f0419e5cc86f1b.tar.gz
urpmi-3b9d01c49e4e49f0c29c3cd990f0419e5cc86f1b.tar.bz2
urpmi-3b9d01c49e4e49f0c29c3cd990f0419e5cc86f1b.tar.xz
urpmi-3b9d01c49e4e49f0c29c3cd990f0419e5cc86f1b.zip
perl_checker compliance
-rwxr-xr-xurpmf25
1 files changed, 13 insertions, 12 deletions
diff --git a/urpmf b/urpmf
index 49511892..ac36de5d 100755
--- a/urpmf
+++ b/urpmf
@@ -24,7 +24,7 @@ use urpm;
use urpm::args;
use urpm::msg;
-sub usage {
+sub usage() {
print N("urpmf version %s
Copyright (C) 2002-2006 Mandriva.
This is free software and may be redistributed under the terms of the GNU GPL.
@@ -122,7 +122,7 @@ $verbose or $urpm->{log} = sub {};
#- count multi-valued tags
my $multi = 0;
my $multitag = '';
-my %multitags = map { $_ => 1 } qw/conffiles conflicts files obsoletes provides requires/;
+my %multitags = map { $_ => 1 } qw(conffiles conflicts files obsoletes provides requires);
my %usedtags;
while ($qf =~ /%[-\d]*(\w+)/g) {
++$multi, $multitag = $1 if $multitags{$1};
@@ -132,15 +132,15 @@ $multi > 1
and $urpm->{fatal}->(1, N("Incorrect format: you may use only one multi-valued tag"));
#- it would be nice to use "my $_" in this callback.
-my $callback = qq<sub {
- my (\$urpm, \$pkg) = \@_;
- local *_;>;
+my $callback = 'sub {
+ my ($urpm, $pkg) = @_;
+ local *_;';
if ($multi) {
- $callback .= qq/
- for my \$mt (\$pkg->$multitag) {/;
+ $callback .= "
+ for my \$mt (\$pkg->$multitag) {";
}
-$callback .= qq<
- \$_ = sprintf(qq{$qf\\n}>;
+$callback .= "
+ \$_ = sprintf(qq{$qf\\n}";
my $sprintfargs = '';
while ($callback =~ /%[-\d]*(\w+)/g) {
@@ -158,12 +158,13 @@ while ($callback =~ /%[-\d]*(\w+)/g) {
$callback =~ s/%([-\d]*)(\w+)/%${1}s/g;
my $next_st = $multi ? 'next' : 'return 1';
$uniq and $uniq = "\n" . ' $uniq{$_} and ' . $next_st . '; $uniq{$_} = 1;';
-$callback .= qq<$sprintfargs);
+$callback .= "$sprintfargs);
$expr or $next_st;$uniq
- print;>;
+ print;";
$callback .= "\n }" if $multi;
$callback .= "\n 1;\n}";
-$urpm->{error}("qf:[$qf]\ncallback:\n$callback") if our $debug;
+our $debug;
+$urpm->{error}("qf:[$qf]\ncallback:\n$callback") if $debug;
$callback = eval $callback;
if ($@) {
$debug and warn "Internal error: $@\n";