summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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";