* [U-Boot] [RFC v2 PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
@ 2016-01-07 12:45 Heiko Schocher
2016-01-07 16:13 ` Wolfgang Denk
2016-01-09 3:35 ` [U-Boot] [U-Boot, RFC, v2] " Tom Rini
0 siblings, 2 replies; 4+ messages in thread
From: Heiko Schocher @ 2016-01-07 12:45 UTC (permalink / raw)
To: u-boot
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>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
running get_maintainer.pl drops warnings with PERL > 5.22 .
In linux this is fixed though above commit.
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.
Changes in v2:
- add Reviewed-by from Andre Przywara
- remove wrong backslash before [A-Z]
- remove change in MAINTAINERS as no longer needed
scripts/get_maintainer.pl | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 4707dfd..83a4e5b 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*(.*)/) {
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);
--
2.5.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [U-Boot] [RFC v2 PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
2016-01-07 12:45 [U-Boot] [RFC v2 PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use Heiko Schocher
@ 2016-01-07 16:13 ` Wolfgang Denk
2016-01-08 5:53 ` Heiko Schocher
2016-01-09 3:35 ` [U-Boot] [U-Boot, RFC, v2] " Tom Rini
1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2016-01-07 16:13 UTC (permalink / raw)
To: u-boot
Dear Heiko,
In message <1452170739-31351-1-git-send-email-hs@denx.de> you wrote:
>
> running get_maintainer.pl drops warnings with PERL > 5.22 .
> In linux this is fixed though above commit.
ACK.
> But ... I get differences when running the python script:
So the Python script ...
> ret = subprocess.call(["scripts/get_maintainer.pl", "-f", tmp])
...basically does the equivalent of running
scripts/get_maintainer.pl -f <directory>/<file>
on the command line.
> and comparing the output from it, based on the original
> u-boot code and the code with this patch ...
What exactly do you mean by "I get differences"? What are the used
values for "directory" and "file" in your test case, and which exact
differences do you get?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Don't try to outweird me, three-eyes. I get stranger things than you
free with my breakfast cereal."
- Zaphod Beeblebrox in "Hitchhiker's Guide to the Galaxy"
^ permalink raw reply [flat|nested] 4+ messages in thread* [U-Boot] [RFC v2 PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
2016-01-07 16:13 ` Wolfgang Denk
@ 2016-01-08 5:53 ` Heiko Schocher
0 siblings, 0 replies; 4+ messages in thread
From: Heiko Schocher @ 2016-01-08 5:53 UTC (permalink / raw)
To: u-boot
Hello Wolfgang,
Am 07.01.2016 um 17:13 schrieb Wolfgang Denk:
> Dear Heiko,
>
> In message <1452170739-31351-1-git-send-email-hs@denx.de> you wrote:
>>
>> running get_maintainer.pl drops warnings with PERL > 5.22 .
>> In linux this is fixed though above commit.
>
> ACK.
>
>> But ... I get differences when running the python script:
>
> So the Python script ...
>
>> ret = subprocess.call(["scripts/get_maintainer.pl", "-f", tmp])
>
> ...basically does the equivalent of running
>
> scripts/get_maintainer.pl -f <directory>/<file>
>
> on the command line.
Yes... the script does this just for *all* files in the u-boot tree.
>> and comparing the output from it, based on the original
>> u-boot code and the code with this patch ...
>
> What exactly do you mean by "I get differences"? What are the used
> values for "directory" and "file" in your test case, and which exact
> differences do you get?
I do exactly (should have written this to the commit text ... sorry):
- python2.7 check_get.py > ../gnlmpf_org
- Apply this patch (with "patch" not with "git am")
to the u-boot tree
- python2.7 check_get.py > ../gnlmpf_new
- diff -purN ../gnlmpf_org ../gnlmpf_new > ../gnlmpf
So I expect only a difference in the "scripts/get_maintainer.pl" file,
as no other file has changed, also no change in the git files...
First difference:
--- ../gnlmpf_org 2016-01-07 13:39:39.059124449 +0100
+++ ../gnlmpf_new 2016-01-07 13:41:57.937391203 +0100
@@ -1,12 +1,11 @@
-Masahiro Yamada <yamada.masahiro@socionext.com> (commit_signer:1/1=100%)
Jagan Teki <jteki@openedev.com> (commit_signer:1/1=100%,authored:1/1=100%)
+Masahiro Yamada <yamada.masahiro@socionext.com> (commit_signer:1/1=100%)
u-boot at lists.denx.de (open list)
Masahiro Yamada <yamada.masahiro@socionext.com> (commit_signer:2/4=50%,authored:2/4=50%)
+Stefan Roese <sr@denx.de> (commit_signer:1/4=25%)
Joe Hershberger <joe.hershberger@ni.com> (commit_signer:1/4=25%,authored:1/4=25%)
Marek Vasut <marex@denx.de> (commit_signer:1/4=25%)
-Stefan Roese <sr@denx.de> (commit_signer:1/4=25%)
-York Sun <yorksun@freescale.com> (commit_signer:1/4=25%)
-Simon Glass <sjg@chromium.org> (authored:1/4=25%)
+Simon Glass <sjg@chromium.org> (commit_signer:1/4=25%,authored:1/4=25%)
u-boot at lists.denx.de (open list)
Masahiro Yamada <yamada.masahiro@socionext.com> (commit_signer:14/24=58%,authored:14/24=58%)
Stefan Roese <sr@denx.de> (commit_signer:4/24=17%)
The "Masahiro" and the "Simon" diff are only a diff in the order,
but "York Sun" is missing complete ...
bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [U-Boot, RFC, v2] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use
2016-01-07 12:45 [U-Boot] [RFC v2 PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use Heiko Schocher
2016-01-07 16:13 ` Wolfgang Denk
@ 2016-01-09 3:35 ` Tom Rini
1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-01-09 3:35 UTC (permalink / raw)
To: u-boot
On Thu, Jan 07, 2016 at 01:45:38PM +0100, 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>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160108/54761c00/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-09 3:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-07 12:45 [U-Boot] [RFC v2 PATCH] get_maintainer: fix perl 5.22/5.24 deprecated/incompatible "\C" use Heiko Schocher
2016-01-07 16:13 ` Wolfgang Denk
2016-01-08 5:53 ` Heiko Schocher
2016-01-09 3:35 ` [U-Boot] [U-Boot, RFC, v2] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox