devtools: fix regex matching literal plus in patches
PATCH 1/1 devtools: fix regex matching literal plus in patches
In Extended Regular Expressions (ERE) as used in awk,
'+' is a quantifier, not a literal character.
The pattern /^+/ matches the start of any line
instead of only lines beginning with a literal '+'.
As a result, check_experimental_tags and check_internal_tags were matching context and removed lines in diffs, causing false positives.
Use [+] character class to unambiguously match a literal '+'.
--- devtools/checkpatches.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
devtools/checkpatches.sh +4 -4
@@ -321,10 +321,10 @@ check_experimental_tags() { # <patch> current_file = ""; ret = 0; } - /^+++ b\// { + /^[+][+][+] b\// { current_file = $2; } - /^+.*__rte_experimental/ { + /^[+].*__rte_experimental/ { if (current_file ~ ".c$" ) { print "Please only put __rte_experimental tags in " \ "headers ("current_file")";
@@ -351,10 +351,10 @@ check_internal_tags() { # <patch> current_file = ""; ret = 0; } - /^+++ b\// { + /^[+][+][+] b\// { current_file = $2; } - /^+.*__rte_internal/ { + /^[+].*__rte_internal/ { if (current_file ~ ".c$" ) { print "Please only put __rte_internal tags in " \ "headers ("current_file")";
Signature · 1 line
2.54.0
Quoted 8 lines · Thomas Monjalon
In Extended Regular Expressions (ERE) as used in awk,
'+' is a quantifier, not a literal character.
The pattern /^+/ matches the start of any line
instead of only lines beginning with a literal '+'.
As a result,check_experimental_tagsandcheck_internal_tagswere matching context and removed lines in diffs, causing false positives.
Quoted 7 lines
Use [+] character class to unambiguously match a literal '+'.
Fixes cfe3aeb170b2 ("remove experimental tags from all symbol definitions")Fixes fba5af82adc8 ("eal: add internal ABI tag definition")Signed-off-by Thomas Monjalon <[email protected]>
Signature · 1 line
David Marchand
Thomas Monjalon
Applied18/05/2026 13:55, David Marchand:
Quoted 11 lines · Thomas Monjalon
Quoted 10 lines
In Extended Regular Expressions (ERE) as used in awk,
'+' is a quantifier, not a literal character.
The pattern /^+/ matches the start of any line
instead of only lines beginning with a literal '+'.
As a result,check_experimental_tagsandcheck_internal_tagswere matching context and removed lines in diffs, causing false positives.Use [+] character class to unambiguously match a literal '+'.
Quoted 7 lines
Quoted 5 lines
Fixes cfe3aeb170b2 ("remove experimental tags from all symbol definitions")Fixes fba5af82adc8 ("eal: add internal ABI tag definition")Signed-off-by Thomas Monjalon <[email protected]>Reviewed-by David Marchand <[email protected]>
Applied