The following commit has been merged in the master branch:
commit 57c5880205d897ad964e96c9c0171b1ce5c0680f
Author: Guillem Jover <[email protected]>
Date:   Tue Apr 16 22:50:44 2013 +0200

    Explicitly quote HEREDOC markers in perl code
    
    This makes the HEREDOC quoting-style used explicit, so that it's obvious
    if the code text will get interpolated or not.
    
    Fixes ValuesAndExpressions::RequireQuotedHeredocTerminator.
    
    Warned-by: perlcritic

diff --git a/dselect/methods/Debian/Dselect/Ftp.pm 
b/dselect/methods/Debian/Dselect/Ftp.pm
index f750b42..f0f98de 100644
--- a/dselect/methods/Debian/Dselect/Ftp.pm
+++ b/dselect/methods/Debian/Dselect/Ftp.pm
@@ -169,7 +169,7 @@ sub edit_site {
   chomp($_ = <STDIN>);
   $site->[4] = $_ || $site->[4];
 
-  print <<EOF;
+  print <<'EOF';
 
 If you're using anonymous ftp to retrieve files, enter your email
 address for use as a password. Otherwise enter your password,
diff --git a/dselect/methods/ftp/setup b/dselect/methods/ftp/setup
index 05ef294..f20e8cd 100755
--- a/dselect/methods/ftp/setup
+++ b/dselect/methods/ftp/setup
@@ -76,7 +76,7 @@ if (! -d "debian") {
 
 $| = 1;
 
-print <<EOM;
+print <<"EOM";
 
 You must supply an ftp site, use of passive mode, username, password,
 path to the debian directory,list of distributions you are interested
diff --git a/dselect/methods/ftp/update b/dselect/methods/ftp/update
index 507b54a..02c77d5 100755
--- a/dselect/methods/ftp/update
+++ b/dselect/methods/ftp/update
@@ -226,7 +226,7 @@ if($@) {
 my $ans;
 
 if ($packages_modified) {      # don't clear if nothing changed
-    print <<EOM;
+    print <<'EOM';
 
 It is a good idea to clear the available list of old packages.
 However if you have only downloaded a Package files from non-main
diff --git a/src/t/100_dpkg_divert.t b/src/t/100_dpkg_divert.t
index 0ea6fdb..0fdf4bc 100644
--- a/src/t/100_dpkg_divert.t
+++ b/src/t/100_dpkg_divert.t
@@ -62,7 +62,7 @@ sub install_filelist {
     close(L);
     # Only installed packages have their files list considered.
     open(S, ">> $admindir/status");
-    print S <<EOF;
+    print S <<"EOF";
 Package: $pkg
 Status: install ok installed
 Version: 0
@@ -203,7 +203,7 @@ cleanup();
 
 note("Querying information from diverts db (1)");
 
-install_diversions(<<EOF);
+install_diversions(<<'EOF');
 /bin/sh
 /bin/sh.distrib
 dash
@@ -239,7 +239,7 @@ cleanup();
 
 note("Querying information from diverts db (2)");
 
-install_diversions(<<EOF);
+install_diversions(<<'EOF');
 /bin/sh
 /bin/sh.distrib
 dash
@@ -261,7 +261,7 @@ cleanup();
 
 note("Adding diversion");
 
-my $diversions_added_foo_local = <<EOF;
+my $diversions_added_foo_local = <<"EOF";
 $testdir/foo
 $testdir/foo.distrib
 :
@@ -346,7 +346,7 @@ note("Adding diversion (7)");
 install_diversions('');
 call_divert(['--quiet', '--rename', '--package', 'bash', "$testdir/foo"],
             expect_stdout => '', expect_stderr => '');
-diversions_eq(<<EOF);
+diversions_eq(<<"EOF");
 $testdir/foo
 $testdir/foo.distrib
 bash
@@ -411,7 +411,7 @@ install_diversions('');
 
 call_divert(['--quiet', '--rename', '--add', "$testdir/zoo/foo"],
             expect_stderr => '', expect_stdout => '');
-diversions_eq(<<EOF);
+diversions_eq(<<"EOF");
 $testdir/zoo/foo
 $testdir/zoo/foo.distrib
 :
@@ -429,7 +429,7 @@ call_divert(['--quiet', '--rename', '--add', '--package', 
'coreutils', "$testdir
             expect_stderr => '', expect_stdout => '');
 ok(-e "$testdir/foo", "foo not renamed");
 ok(!-e "$testdir/foo.distrib", "foo renamed");
-diversions_eq(<<EOF);
+diversions_eq(<<"EOF");
 $testdir/foo
 $testdir/foo.distrib
 coreutils
@@ -462,7 +462,7 @@ call_divert(["--package", "baz", "--divert", 
"$testdir/foo.my", "--remove", "$te
 
 call_divert(["--divert", "$testdir/foo.distrib", "--remove", "$testdir/foo"],
             expect_stdout_like => qr,Removing.*\Q$testdir\E/foo,);
-diversions_eq(<<EOF);
+diversions_eq(<<"EOF");
 $testdir/bar
 $testdir/bar.distrib
 :
@@ -483,7 +483,7 @@ call_divert(["$testdir/baz"]);
 
 call_divert(["--remove", "$testdir/bar"],
             expect_stdout_like => qr,Removing.*\Q$testdir\E/bar,);
-diversions_eq(<<EOF);
+diversions_eq(<<"EOF");
 $testdir/foo
 $testdir/foo.distrib
 :
@@ -504,7 +504,7 @@ call_divert(["--package", "bash", "$testdir/baz"]);
 
 call_divert(["--quiet", "--package", "bash", "--remove", "$testdir/baz"],
             expect_stdout => '', expect_stderr => '');
-diversions_eq(<<EOF);
+diversions_eq(<<"EOF");
 $testdir/foo
 $testdir/foo.distrib
 :
@@ -549,14 +549,14 @@ SKIP: {
     system("chmod 644 $admindir/diversions");
 }
 
-install_diversions(<<EOF);
+install_diversions(<<'EOF');
 /bin/sh
 EOF
 
 call_divert_sort(['--list'], expect_failure => 1,
             expect_stderr_like => qr/(corrupt|unexpected eof)/, expect_stdout 
=> '');
 
-install_diversions(<<EOF);
+install_diversions(<<'EOF');
 /bin/sh
 bash
 EOF
diff --git a/test/100_critic.t b/test/100_critic.t
index 8c76827..371ba5c 100644
--- a/test/100_critic.t
+++ b/test/100_critic.t
@@ -67,6 +67,7 @@ my @policies = qw(
     ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator
     ValuesAndExpressions::ProhibitVersionStrings
     ValuesAndExpressions::RequireConstantVersion
+    ValuesAndExpressions::RequireQuotedHeredocTerminator
     ValuesAndExpressions::RequireUpperCaseHeredocTerminator
     Variables::ProhibitAugmentedAssignmentInDeclaration
     Variables::ProhibitPerl4PackageNames

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to