summaryrefslogtreecommitdiff
path: root/dselect
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-04-04 21:59:10 +0200
committerGuillem Jover <guillem@debian.org>2014-05-17 13:30:52 +0200
commit79a6978160ccf752d058786ab8fb61ad7fa1646a (patch)
tree3561e7760eb95d067398c826fa55536574b916b8 /dselect
parent0e5d6ee28bd2bbb542405b8d1e7de5a6ecf47c1d (diff)
downloaddpkg-79a6978160ccf752d058786ab8fb61ad7fa1646a.tar.gz
perl: Do not use global match variables
Fixes Variables::ProhibitMatchVars. Warned-by: perlcritic
Diffstat (limited to 'dselect')
-rwxr-xr-xdselect/methods/disk/setup6
-rwxr-xr-xdselect/methods/multicd/setup6
-rwxr-xr-xdselect/mkcurkeys.pl12
3 files changed, 12 insertions, 12 deletions
diff --git a/dselect/methods/disk/setup b/dselect/methods/disk/setup
index cc7e697c5..0ee15bcaa 100755
--- a/dselect/methods/disk/setup
+++ b/dselect/methods/disk/setup
@@ -96,7 +96,7 @@ getblockdev () {
set -e
proposeddevice="$tryblockdevice" perl -ne '
next unless /^ *Device +Boot +Start +End +Blocks +Id +System *$/i .. !/\S/;
-next unless s:^/\S+:: && $& eq $ENV{proposeddevice};
+next unless s:^/\S+::p && ${^MATCH} eq $ENV{proposeddevice};
next unless s/^ +(\* +)?\d+ +\d+ +\d+\+? +//;
next unless m/^([0-9a-f]{1,2}) /i;
%types= ( "1","msdos", "4","msdos", "6","msdos", "7","hpfs", "80","minix",
@@ -314,8 +314,8 @@ then
perl -ne '
next unless /^ *Device +Boot +Start +End +Blocks +Id +System *$/i .. !/\S/;
next unless / [146] +DOS \d+-bit \S+$/;
-next unless m:^/\S+:;
-print $&; ' <$tp.f >$tp.d
+next unless m:^/\S+:p;
+print ${^MATCH}; ' <$tp.f >$tp.d
newdefaultdevice="`cat $tp.d`"
echo "
I need to know which disk partition contains the distribution files;
diff --git a/dselect/methods/multicd/setup b/dselect/methods/multicd/setup
index 559ca20c0..c84e484f6 100755
--- a/dselect/methods/multicd/setup
+++ b/dselect/methods/multicd/setup
@@ -122,7 +122,7 @@ getblockdev () {
set -e
proposeddevice="$tryblockdevice" perl -ne '
next unless /^ *Device +Boot +Begin +Start +End +Blocks +Id +System *$/i .. !/\S/;
-next unless s:^/\S+:: && $& eq $ENV{proposeddevice};
+next unless s:^/\S+::p && ${^MATCH} eq $ENV{proposeddevice};
next unless s/^ +(\* +)?\d+ +\d+ +\d+ +\d+\+? +//;
next unless m/^([0-9a-f]{1,2}) /i;
%types= ( "1","msdos", "4","msdos", "6","msdos", "7","hpfs", "80","minix",
@@ -342,8 +342,8 @@ then
perl -ne '
next unless /^ *Device +Boot +Begin +Start +End +Blocks +Id +System *$/i .. !/\S/;
next unless / [146] +DOS \d+-bit \S+$/;
-next unless m:^/\S+:;
-print $&; ' <$tp.f >$tp.d
+next unless m:^/\S+:p;
+print ${^MATCH}; ' <$tp.f >$tp.d
newdefaultdevice="`cat $tp.d`"
echo "
I need to know which disk partition contains the distribution files;
diff --git a/dselect/mkcurkeys.pl b/dselect/mkcurkeys.pl
index 19a06e321..d433b93b9 100755
--- a/dselect/mkcurkeys.pl
+++ b/dselect/mkcurkeys.pl
@@ -53,8 +53,8 @@ my ($k, $v);
open(my $header_fh, '<', $ARGV[1]) or die $!;
while (<$header_fh>) {
s/\s+$//;
- m/#define KEY_(\w+)\s+\d+\s+/ || next;
- my $rhs = $';
+ m/#define KEY_(\w+)\s+\d+\s+/p || next;
+ my $rhs = ${^POSTMATCH};
$k= "KEY_$1";
$_= $1;
capit();
@@ -122,12 +122,12 @@ sub capit {
my $o = '';
y/A-Z/a-z/;
$_ = " $_";
- while (m/ (\w)/) {
- $o .= $`.' ';
+ while (m/ (\w)/p) {
+ $o .= ${^PREMATCH} . ' ';
$_ = $1;
y/a-z/A-Z/;
$o .= $_;
- $_ = $';
+ $_ = ${^POSTMATCH};
}
$_= $o.$_; s/^ //;
}
@@ -135,6 +135,6 @@ sub capit {
sub p {
my ($k, $v) = @_;
- $v =~ s/["\\]/\\$&/g;
+ $v =~ s/["\\]/\\${^MATCH}/pg;
printf(" { %-15s \"%-20s },\n", $k . ',', $v . '"') or die $!;
}