All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
Date: Mon, 4 Jan 2016 16:12:51 +0000	[thread overview]
Message-ID: <568A9A03.9010601@arm.com> (raw)
In-Reply-To: <1451906263-28116-1-git-send-email-hs@denx.de>

Hi,

On 04/01/16 11:17, Heiko Schocher wrote:
> from linux commit ce8155f7a3d5:
> 
> 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.
> 
> From linux adapted to U-Boot by:
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
> running get_maintainer.pl drops warnings with PERL > 5.22 .
> In linux this is fixed though above commit.
> 
> With the original linux patch applied to u-boot, there
> is following warning:
> 
> ^* matches null string many times in regex; marked by <-- HERE in m/^* <-- HERE /@./scripts/get_maintainer.pl line 739.
> ^* matches null string many times in regex; marked by <-- HERE in m/^* <-- HERE //@./scripts/get_maintainer.pl line 735.
> 
> The change in MAINTAINERS fixes this, but I get differences
> when running the python script:
> import os
> import subprocess
> 
> root_dir = '.'
> 
> for directory, subdirectories, files in os.walk(root_dir):
>     for file in files:
>         tmp=os.path.join(directory, file)
>         print(tmp)
>         ret = subprocess.call(["scripts/get_maintainer.pl", "-f", tmp])
> 
> and comparing the output from it, based on the original
> u-boot code and the code with this patch ...
> 
> I have no PERL experience, so made this patch as RFC, maybe
> someone with better PERL skills can fix it correct.
> 
> 
>  MAINTAINERS               |  4 ++--
>  scripts/get_maintainer.pl | 22 +++++++++++-----------
>  2 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5b3c93a..a197cd0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -417,5 +417,5 @@ L:	u-boot at lists.denx.de
>  Q:	http://patchwork.ozlabs.org/project/uboot/list/
>  S:	Maintained
>  T:	git git://git.denx.de/u-boot.git
> -F:	*
> -F:	*/
> +F:	.*
> +F:	.*/
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> index 4707dfd..308d7f0 100755
> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl
> @@ -298,7 +298,7 @@ sub read_maintainers {
>      while (<$maint>) {
>  	my $line = $_;
>  
> -	if ($line =~ m/^(\C):\s*(.*)/) {
> +	if ($line =~ m/^(\[A-Z]):\s*(.*)/) {

The backslash shouldn't be in here anymore, right?

Other than that, for the get_maintainer.pl part at least (since I was
about sending out almost the same patch):

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre.

>  	    my $type = $1;
>  	    my $value = $2;
>  
> @@ -533,7 +533,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') {
> @@ -551,7 +551,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') {
> @@ -600,7 +600,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') {
> @@ -615,7 +615,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') {
> @@ -917,7 +917,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++;
> @@ -931,7 +931,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--;
> @@ -945,7 +945,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++;
> @@ -971,7 +971,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") {
> @@ -1030,7 +1030,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") {
> @@ -1072,7 +1072,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);
> 

      reply	other threads:[~2016-01-04 16:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 11:17 [U-Boot] [RFC PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use Heiko Schocher
2016-01-04 16:12 ` Andre Przywara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=568A9A03.9010601@arm.com \
    --to=andre.przywara@arm.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.