mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-21 17:35:55 +01:00
Handle non-string and non-list values in substitutions (subst)
This commit is contained in:
parent
15d14c7bdf
commit
d68e1ff072
@ -3,3 +3,4 @@ Description: ПРИЛОЖЕНИЕ
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lgnaa @LIBS@ @XPM_LIBS@ @LIBICONV@
|
||||
Cflags: -I${includedir} @XPM_CFLAGS@
|
||||
extra: @INTVAR@
|
||||
|
@ -13,7 +13,7 @@ def configure(conf):
|
||||
def build(bld):
|
||||
|
||||
# the test.pc.in is a special case which is always handled
|
||||
bld(source='test.pc.in', VERSION='1.1', LIBS='moo', XPM_LIBS='-lxpm', LIBICONV='-liconv', XPM_CFLAGS='-O3')
|
||||
bld(source='test.pc.in', VERSION='1.1', LIBS='moo', XPM_LIBS='-lxpm', LIBICONV='-liconv', XPM_CFLAGS='-O3', INTVAR=12)
|
||||
|
||||
tg = bld(
|
||||
features = 'subst', # the feature 'subst' overrides the source/target processing
|
||||
|
@ -701,8 +701,12 @@ class subst_pc(Task.Task):
|
||||
except AttributeError:
|
||||
d = {}
|
||||
for x in lst:
|
||||
tmp = getattr(self.generator, x, '') or self.env.get_flat(x) or self.env.get_flat(x.upper())
|
||||
d[x] = str(tmp)
|
||||
tmp = getattr(self.generator, x, '') or self.env[x] or self.env[x.upper()]
|
||||
try:
|
||||
tmp = ''.join(tmp)
|
||||
except TypeError:
|
||||
tmp = str(tmp)
|
||||
d[x] = tmp
|
||||
|
||||
code = code % d
|
||||
self.outputs[0].write(code, encoding=getattr(self.generator, 'encoding', 'ISO8859-1'))
|
||||
|
Loading…
Reference in New Issue
Block a user