Skip to contentSkip to conversation

get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use

PATCH In review Olaf Hering 2 participants 2 messages Nov 19, 2015 – Nov 24, 2015 GET_MAINTAINER script

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use

From: Joe Perches <[email protected]>

Perl 5.22 emits a deprecated message when "\C" is used in a regex. Perl 5.24 will disallow it altogether.

Fix it by using [A-Z] instead of \C.

[ Upstream commit ce8155f7a3d59ce868ea16d8891edda4d865e873 ]

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Keir Fraser <[email protected]>
Cc Tim Deegan <[email protected]>
---
 scripts/get_maintainer.pl | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
scripts/get_maintainer.pl +11 -11
index cc445cd..9fda278 100755
@@ -277,7 +277,7 @@ open (my $maint, '<', "${xen_path}MAINTAINERS")
 while (<$maint>) {
     my $line = $_;
 
-    if ($line =~ m/^(\C):\s*(.*)/) {
+    if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	my $type = $1;
 	my $value = $2;
 
@@ -512,7 +512,7 @@ sub range_is_maintained {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'S') {
@@ -530,7 +530,7 @@ sub range_has_maintainer {
 
     for (my $i = $start; $i < $end; $i++) {
 	my $line = $typevalue[$i];
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'M') {
@@ -579,7 +579,7 @@ sub get_maintainers {
 
 	    for ($i = $start; $i < $end; $i++) {
 		my $line = $typevalue[$i];
-		if ($line =~ m/^(\C):\s*(.*)/) {
+		if ($line =~ m/^([A-Z]):\s*(.*)/) {
 		    my $type = $1;
 		    my $value = $2;
 		    if ($type eq 'X') {
@@ -594,7 +594,7 @@ sub get_maintainers {
 	    if (!$exclude) {
 		for ($i = $start; $i < $end; $i++) {
 		    my $line = $typevalue[$i];
-		    if ($line =~ m/^(\C):\s*(.*)/) {
+		    if ($line =~ m/^([A-Z]):\s*(.*)/) {
 			my $type = $1;
 			my $value = $2;
 			if ($type eq 'F') {
@@ -897,7 +897,7 @@ sub find_first_section {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (($tv =~ m/^(\C):\s*(.*)/)) {
+	if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -911,7 +911,7 @@ sub find_starting_index {
 
     while ($index > 0) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index--;
@@ -925,7 +925,7 @@ sub find_ending_index {
 
     while ($index < @typevalue) {
 	my $tv = $typevalue[$index];
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
 	    last;
 	}
 	$index++;
@@ -951,7 +951,7 @@ sub get_maintainer_role {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "S") {
@@ -1010,7 +1010,7 @@ sub add_categories {
 
     for ($i = $start + 1; $i < $end; $i++) {
 	my $tv = $typevalue[$i];
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "L") {
@@ -1052,7 +1052,7 @@ sub add_categories {
 		if ($name eq "") {
 		    if ($i > 0) {
 			my $tv = $typevalue[$i - 1];
-			if ($tv =~ m/^(\C):\s*(.*)/) {
+			if ($tv =~ m/^([A-Z]):\s*(.*)/) {
 			    if ($1 eq "P") {
 				$name = $2;
 				$pvalue = format_email($name, $address, $email_usename);
#1 lore raw
Quoted 6 lines · Olaf Hering

From: Joe Perches <[email protected]>

Perl 5.22 emits a deprecated message when "\C" is used in a regex.  Perl 5.24 will disallow it altogether.

Fix it by using [A-Z] instead of \C.

They aren't quite equivalent, but [A-Z] suffices for the usage here.

Quoted 3 lines

 [ Upstream commit ce8155f7a3d59ce868ea16d8891edda4d865e873 ]

Acked + applied.

Quoted 112 lines
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Keir Fraser <[email protected]>
Cc Tim Deegan <[email protected]>

---
 scripts/get_maintainer.pl | 22 +++++++++++-----------

 1 file changed, 11 insertions(+), 11 deletions(-)
scripts/get_maintainer.pl +0 -0
index cc445cd..9fda278 100755
@@ -277,7 +277,7 @@ open (my $maint, '<', "${xen_path}MAINTAINERS")
  while (<$maint>) {
      my $line = $_;


-    if ($line =~ m/^(\C):\s*(.*)/) {
+    if ($line =~ m/^([A-Z]):\s*(.*)/) {
  my $type = $1;
  my $value = $2;

scripts/get_maintainer.pl +0 -0
@@ -512,7 +512,7 @@ sub range_is_maintained {


     for (my $i = $start; $i < $end; $i++) {
  my $line = $typevalue[$i];

scripts/get_maintainer.pl +1 -1
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {

      my $type = $1;
      my $value = $2;
      if ($type eq 'S') {

scripts/get_maintainer.pl +0 -0
@@ -530,7 +530,7 @@ sub range_has_maintainer {


     for (my $i = $start; $i < $end; $i++) {
  my $line = $typevalue[$i];

scripts/get_maintainer.pl +1 -1
-	if ($line =~ m/^(\C):\s*(.*)/) {
+	if ($line =~ m/^([A-Z]):\s*(.*)/) {

      my $type = $1;
      my $value = $2;
      if ($type eq 'M') {

scripts/get_maintainer.pl +0 -0
@@ -579,7 +579,7 @@ sub get_maintainers {


      for ($i = $start; $i < $end; $i++) {
  my $line = $typevalue[$i];

scripts/get_maintainer.pl +1 -1
-		if ($line =~ m/^(\C):\s*(.*)/) {
+		if ($line =~ m/^([A-Z]):\s*(.*)/) {

      my $type = $1;
      my $value = $2;
      if ($type eq 'X') {

scripts/get_maintainer.pl +1 -1
@@ -594,7 +594,7 @@ sub get_maintainers {
  	    if (!$exclude) {
  		for ($i = $start; $i < $end; $i++) {
  		    my $line = $typevalue[$i];
-		    if ($line =~ m/^(\C):\s*(.*)/) {
+		    if ($line =~ m/^([A-Z]):\s*(.*)/) {
  			my $type = $1;
  			my $value = $2;
  			if ($type eq 'F') {
@@ -897,7 +897,7 @@ sub find_first_section {


     while ($index < @typevalue) {
  my $tv = $typevalue[$index];

scripts/get_maintainer.pl +1 -1
-	if (($tv =~ m/^(\C):\s*(.*)/)) {
+	if (($tv =~ m/^([A-Z]):\s*(.*)/)) {

      last;
  }
  $index++;

scripts/get_maintainer.pl +0 -0
@@ -911,7 +911,7 @@ sub find_starting_index {


     while ($index > 0) {
  my $tv = $typevalue[$index];

scripts/get_maintainer.pl +1 -1
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {

      last;
  }
  $index--;

scripts/get_maintainer.pl +0 -0
@@ -925,7 +925,7 @@ sub find_ending_index {


     while ($index < @typevalue) {
  my $tv = $typevalue[$index];

scripts/get_maintainer.pl +1 -1
-	if (!($tv =~ m/^(\C):\s*(.*)/)) {
+	if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {

      last;
  }
  $index++;

scripts/get_maintainer.pl +0 -0
@@ -951,7 +951,7 @@ sub get_maintainer_role {


     for ($i = $start + 1; $i < $end; $i++) {
  my $tv = $typevalue[$i];

scripts/get_maintainer.pl +1 -1
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {

      my $ptype = $1;
      my $pvalue = $2;
      if ($ptype eq "S") {

scripts/get_maintainer.pl +0 -0
@@ -1010,7 +1010,7 @@ sub add_categories {


     for ($i = $start + 1; $i < $end; $i++) {
  my $tv = $typevalue[$i];

scripts/get_maintainer.pl +1 -1
-	if ($tv =~ m/^(\C):\s*(.*)/) {
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {

      my $ptype = $1;
      my $pvalue = $2;
      if ($ptype eq "L") {

scripts/get_maintainer.pl +1 -1
@@ -1052,7 +1052,7 @@ sub add_categories {
  		if ($name eq "") {
  		    if ($i > 0) {
  			my $tv = $typevalue[$i - 1];
-			if ($tv =~ m/^(\C):\s*(.*)/) {
+			if ($tv =~ m/^([A-Z]):\s*(.*)/) {
  			    if ($1 eq "P") {
  				$name = $2;
  				$pvalue = format_email($name, $address,
Quoted 1 line

$email_usename);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel