In the modify_pc.py script, regular expressions are used to parse
symbols and values. There are symbols separated from its value by a
colon(':') and by a equal sign('='). These two symbols are parsed by
regular expression but these regular expressions are incomplete since
content like below cannot be parsed properly.
Cflags: -DAAAA=1 -DBBBB=...
In this case, it should be recognized as a colon symbol, which symbol is
"Cflags" and value is "-DAAAA=1 -DBBBB=...". But because of '=' in the
value, it was parsed as: symbol is "-DAAAA", value is "1 -DBBBB=...".
To resolve this bug issue, two anchors '^' and '$' are added to the
regular expression to represent the beginning and end of a string,
respectively.
Change-Id: I12b9b6eb2eba4142ac72ab7e01b6e428c7ed75d4
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
class PkgConfig:
regex_comment = compile_regex("([^#]*)(#.*)?")
- regex_assignment = compile_regex("\\s*([-_a-zA-Z0-9]+)\\s*=\\s*([^\\s]*)")
- regex_declaration = compile_regex("\\s*([-_a-zA-Z0-9]+)\\s*:\\s*(.*)\\s*")
+ regex_assignment = compile_regex("^\\s*([-_a-zA-Z0-9]+)\\s*=\\s*([^\\s]*)$")
+ regex_declaration = compile_regex("^\\s*([-_a-zA-Z0-9]+)\\s*:\\s*(.*)\\s*$")
regex_substitution = compile_regex("\\${([-_a-zA-Z0-9]+)}")
regex_root_substitution = compile_regex("^-([a-zA-Z])/(.*)$")