mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb/setbuilder: Support line continuation
This commit is contained in:
parent
17106e0e3c
commit
3a4892dce1
@ -284,6 +284,13 @@ class buildset:
|
|||||||
line = line[1:b]
|
line = line[1:b]
|
||||||
return line.strip()
|
return line.strip()
|
||||||
|
|
||||||
|
def _clean_and_pack(line, last_line):
|
||||||
|
leading_ws = ' ' if len(line) > 0 and line[0].isspace() else ''
|
||||||
|
line = _clean(line)
|
||||||
|
if len(last_line) > 0:
|
||||||
|
line = last_line + leading_ws + line
|
||||||
|
return line
|
||||||
|
|
||||||
bset = macro_expand(self.macros, bset)
|
bset = macro_expand(self.macros, bset)
|
||||||
bsetname = bset
|
bsetname = bset
|
||||||
|
|
||||||
@ -306,11 +313,16 @@ class buildset:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
lc = 0
|
lc = 0
|
||||||
|
ll = ''
|
||||||
for l in bset:
|
for l in bset:
|
||||||
lc += 1
|
lc += 1
|
||||||
l = _clean(l)
|
l = _clean_and_pack(l, ll)
|
||||||
if len(l) == 0:
|
if len(l) == 0:
|
||||||
continue
|
continue
|
||||||
|
if l[-1] == '\\':
|
||||||
|
ll = l[0:-1]
|
||||||
|
continue
|
||||||
|
ll = ''
|
||||||
log.trace('_bset: : %s: %03d: %s' % (self.bset, lc, l))
|
log.trace('_bset: : %s: %03d: %s' % (self.bset, lc, l))
|
||||||
ls = l.split()
|
ls = l.split()
|
||||||
if ls[0][-1] == ':' and ls[0][:-1] == 'package':
|
if ls[0][-1] == ':' and ls[0][:-1] == 'package':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user