* [PATCH 1/2] contrib: allow override-style syntax for vars & routines
@ 2021-12-17 2:59 Jeremy Kerr
2021-12-17 2:59 ` [PATCH 2/2] contrib: fix python warnings for oe-stylize Jeremy Kerr
0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Kerr @ 2021-12-17 2:59 UTC (permalink / raw)
To: openembedded-devel
Currently, the variable and routine regexes don't support the
override-style syntax. This means we may break routine blocks, as we
don't recognise overridden routines with an :append/:prepend/etc.
This change adds the ":" char to the var & routine regexes.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
contrib/oe-stylize.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/oe-stylize.py b/contrib/oe-stylize.py
index e1ba1b321..67c06b1bb 100755
--- a/contrib/oe-stylize.py
+++ b/contrib/oe-stylize.py
@@ -210,8 +210,8 @@ OE_vars = [
'others'
]
-varRegexp = r'^([a-zA-Z_0-9${}-]*)([ \t]*)([+.:]?=[+.]?)([ \t]*)([^\t]+)'
-routineRegexp = r'^([a-zA-Z0-9_ ${}-]+?)\('
+varRegexp = r'^([a-zA-Z_0-9${}:-]*)([ \t]*)([+.:]?=[+.]?)([ \t]*)([^\t]+)'
+routineRegexp = r'^([a-zA-Z0-9_ ${}:-]+?)\('
# Variables seen in the processed .bb
seen_vars = {}
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] contrib: fix python warnings for oe-stylize
2021-12-17 2:59 [PATCH 1/2] contrib: allow override-style syntax for vars & routines Jeremy Kerr
@ 2021-12-17 2:59 ` Jeremy Kerr
0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Kerr @ 2021-12-17 2:59 UTC (permalink / raw)
To: openembedded-devel
I get a couple of python SyntaxWarnings when running oe-stylize:
[jk@pecola meta-openembedded]$ python3 contrib/oe-stylize.py
contrib/oe-stylize.py:372: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if line is not '':
contrib/oe-stylize.py:389: SyntaxWarning: "is" with a literal. Did you mean "=="?
if line.isspace() or line is '':
The 'is' operator is for object reference comparison, which is not what
we want here. Change to '==' / '!=' instead.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
contrib/oe-stylize.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/oe-stylize.py b/contrib/oe-stylize.py
index 67c06b1bb..30b460e12 100755
--- a/contrib/oe-stylize.py
+++ b/contrib/oe-stylize.py
@@ -369,7 +369,7 @@ if __name__ == "__main__":
line = line.expandtabs().rstrip()
# ignore empty lines (or line filled with spaces or tabs only)
# so that rule6 is always respected
- if line is not '':
+ if line != '':
lines.append(line)
# -- parse the file --
@@ -386,7 +386,7 @@ if __name__ == "__main__":
line = follow_rule(6, line)
# ignore empty lines
- if line.isspace() or line is '':
+ if line.isspace() or line == '':
# flush comments into the olines
for c in commentBloc:
olines.append(c)
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-17 2:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 2:59 [PATCH 1/2] contrib: allow override-style syntax for vars & routines Jeremy Kerr
2021-12-17 2:59 ` [PATCH 2/2] contrib: fix python warnings for oe-stylize Jeremy Kerr
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.