pmb.parse.parse_attribute: strip off trailing comment on attrib line (MR 2149)
The apkbuild parser could not handle cases where a line ends in a comment but the value is not quoted. E.g. this: pkgver=1.0 # I'm a comment, look at me was being parsed to a value like this: 1.0 # I'm a comment, look at me ... which is obviously wrong. This strips off any trailing comment on the line, so it's parsed to the correct value. fixes #2087
This commit is contained in:
parent
672ebe797b
commit
58e4e86b6b
|
@ -159,6 +159,7 @@ def parse_attribute(attribute, lines, i, path):
|
|||
|
||||
# Single line
|
||||
if not end_char:
|
||||
value = value.split("#")[0].rstrip()
|
||||
return (True, value, i)
|
||||
if end_char in value:
|
||||
value = value.split(end_char, 1)[0]
|
||||
|
|
Loading…
Reference in New Issue