scripts: extract: globals.py: fix node name when it includes "@"

In some cases, node label could be generated with "/" character
in name string, which prevents compilation

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
This commit is contained in:
Erwan Gouriou 2018-02-23 11:52:20 +01:00 committed by Kumar Gala
commit ad29ec69dd

View file

@ -29,10 +29,11 @@ name_config = {
def convert_string_to_label(s):
# Transmute ,-@ to _
# Transmute ,-@/ to _
s = s.replace("-", "_")
s = s.replace(",", "_")
s = s.replace("@", "_")
s = s.replace("/", "_")
# Uppercase the string
s = s.upper()
return s
@ -155,7 +156,8 @@ def get_reduced(nodes, path):
def get_node_label(node_compat, node_address):
def_label = convert_string_to_label(node_compat)
if '@' in node_address:
def_label += '_' + node_address.split('@')[-1].upper()
def_label += '_' + \
convert_string_to_label(node_address.split('@')[-1])
else:
def_label += convert_string_to_label(node_address)