* [dpdk-dev] [PATCH] check-symbol-change: fix regex to match on end of map file
@ 2018-11-01 13:54 Neil Horman
2018-11-01 22:53 ` Thomas Monjalon
0 siblings, 1 reply; 4+ messages in thread
From: Neil Horman @ 2018-11-01 13:54 UTC (permalink / raw)
To: dev; +Cc: Neil Horman, thomas, doucette
the regex to determine the end of the map file chunk in a patch seems to
be wrong, It was using perl regex syntax, which awk doesn't appear to
support (I'm still not sure how it was working previously). Regardless,
it wasn't triggering and as a result symbols were getting added to the
mapdb that shouldn't be there.
Fix it by converting the regex to use traditional posix syntax, matching
only on the negation of the character class [^map]
Tested and shown to be working on the ip_frag patch set provided by
doucette@bu.edu
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: thomas@monjalon.net
CC: doucette@bu.edu
Reported-by: doucette@bu.edu
---
devtools/check-symbol-change.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh
index c0d2a6da1..1d21e9165 100755
--- a/devtools/check-symbol-change.sh
+++ b/devtools/check-symbol-change.sh
@@ -23,7 +23,7 @@ build_map_changes()
# does not end in 'map', indicating we have left the map chunk.
# When we hit this, turn off the in_map variable, which
# supresses the subordonate rules below
- /[-+] a\/.*\.^(map)/ {in_map=0}
+ /[-+] a\/.*\.[^map]/ {in_map=0}
# Triggering this rule, which starts a line and ends it
# with a { identifies a versioned section. The section name is
@@ -153,7 +153,6 @@ clean_and_exit_on_sig()
build_map_changes "$patch" "$mapfile"
check_for_rule_violations "$mapfile"
exit_code=$?
-
rm -f "$mapfile"
exit $exit_code
--
2.17.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] check-symbol-change: fix regex to match on end of map file
2018-11-01 13:54 [dpdk-dev] [PATCH] check-symbol-change: fix regex to match on end of map file Neil Horman
@ 2018-11-01 22:53 ` Thomas Monjalon
2018-11-02 11:50 ` Neil Horman
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2018-11-01 22:53 UTC (permalink / raw)
To: Neil Horman; +Cc: dev, doucette
01/11/2018 14:54, Neil Horman:
> the regex to determine the end of the map file chunk in a patch seems to
> be wrong, It was using perl regex syntax, which awk doesn't appear to
> support (I'm still not sure how it was working previously). Regardless,
> it wasn't triggering and as a result symbols were getting added to the
> mapdb that shouldn't be there.
>
> Fix it by converting the regex to use traditional posix syntax, matching
> only on the negation of the character class [^map]
>
> Tested and shown to be working on the ip_frag patch set provided by
> doucette@bu.edu
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: thomas@monjalon.net
> CC: doucette@bu.edu
> Reported-by: doucette@bu.edu
You could use these lines:
Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
Reported-by: Cody Doucette <doucette@bu.edu>
> --- a/devtools/check-symbol-change.sh
> +++ b/devtools/check-symbol-change.sh
> - /[-+] a\/.*\.^(map)/ {in_map=0}
> + /[-+] a\/.*\.[^map]/ {in_map=0}
Not sure this is what you intend:
[^map] means any character except "m", "a" and "p".
I don't know whether awk supports this syntax: (?!foo)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] check-symbol-change: fix regex to match on end of map file
2018-11-01 22:53 ` Thomas Monjalon
@ 2018-11-02 11:50 ` Neil Horman
2018-11-18 22:25 ` Thomas Monjalon
0 siblings, 1 reply; 4+ messages in thread
From: Neil Horman @ 2018-11-02 11:50 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, doucette
On Thu, Nov 01, 2018 at 11:53:00PM +0100, Thomas Monjalon wrote:
> 01/11/2018 14:54, Neil Horman:
> > the regex to determine the end of the map file chunk in a patch seems to
> > be wrong, It was using perl regex syntax, which awk doesn't appear to
> > support (I'm still not sure how it was working previously). Regardless,
> > it wasn't triggering and as a result symbols were getting added to the
> > mapdb that shouldn't be there.
> >
> > Fix it by converting the regex to use traditional posix syntax, matching
> > only on the negation of the character class [^map]
> >
> > Tested and shown to be working on the ip_frag patch set provided by
> > doucette@bu.edu
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: thomas@monjalon.net
> > CC: doucette@bu.edu
> > Reported-by: doucette@bu.edu
>
> You could use these lines:
>
> Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
>
> Reported-by: Cody Doucette <doucette@bu.edu>
>
I'm fine with the second line, and the first is fine I guess, but I'm not sure
there is an exact correlation
> > --- a/devtools/check-symbol-change.sh
> > +++ b/devtools/check-symbol-change.sh
> > - /[-+] a\/.*\.^(map)/ {in_map=0}
> > + /[-+] a\/.*\.[^map]/ {in_map=0}
>
> Not sure this is what you intend:
> [^map] means any character except "m", "a" and "p".
>
Its not 100%, but its pretty close. The regex for exact matching on not a
specific string is pretty large and complex. Since we have no files that that
end in .m .a or .p, this should give us what we want for the forseeable future.
> I don't know whether awk supports this syntax: (?!foo)
>
It unfortunately doesn't, thats perl syntax, and while grep I think supports it,
awk is more strictly posix compliant.
Neil
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] check-symbol-change: fix regex to match on end of map file
2018-11-02 11:50 ` Neil Horman
@ 2018-11-18 22:25 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-11-18 22:25 UTC (permalink / raw)
To: Neil Horman; +Cc: dev, doucette
02/11/2018 12:50, Neil Horman:
> On Thu, Nov 01, 2018 at 11:53:00PM +0100, Thomas Monjalon wrote:
> > 01/11/2018 14:54, Neil Horman:
> > > the regex to determine the end of the map file chunk in a patch seems to
> > > be wrong, It was using perl regex syntax, which awk doesn't appear to
> > > support (I'm still not sure how it was working previously). Regardless,
> > > it wasn't triggering and as a result symbols were getting added to the
> > > mapdb that shouldn't be there.
> > >
> > > Fix it by converting the regex to use traditional posix syntax, matching
> > > only on the negation of the character class [^map]
> > >
> > > Tested and shown to be working on the ip_frag patch set provided by
> > > doucette@bu.edu
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > CC: thomas@monjalon.net
> > > CC: doucette@bu.edu
> > > Reported-by: doucette@bu.edu
> >
> > You could use these lines:
> >
> > Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
> >
> > Reported-by: Cody Doucette <doucette@bu.edu>
> >
> I'm fine with the second line, and the first is fine I guess, but I'm not sure
> there is an exact correlation
>
> > > --- a/devtools/check-symbol-change.sh
> > > +++ b/devtools/check-symbol-change.sh
> > > - /[-+] a\/.*\.^(map)/ {in_map=0}
> > > + /[-+] a\/.*\.[^map]/ {in_map=0}
> >
> > Not sure this is what you intend:
> > [^map] means any character except "m", "a" and "p".
> >
> Its not 100%, but its pretty close. The regex for exact matching on not a
> specific string is pretty large and complex. Since we have no files that that
> end in .m .a or .p, this should give us what we want for the forseeable future.
>
> > I don't know whether awk supports this syntax: (?!foo)
> >
> It unfortunately doesn't, thats perl syntax, and while grep I think supports it,
> awk is more strictly posix compliant.
I understand now.
Applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-18 22:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 13:54 [dpdk-dev] [PATCH] check-symbol-change: fix regex to match on end of map file Neil Horman
2018-11-01 22:53 ` Thomas Monjalon
2018-11-02 11:50 ` Neil Horman
2018-11-18 22:25 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).