2
0
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:
Thomas Nagy 2015-02-07 22:27:54 +01:00
parent 15d14c7bdf
commit d68e1ff072
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
3 changed files with 8 additions and 3 deletions

View File

@ -3,3 +3,4 @@ Description: ПРИЛОЖЕНИЕ
Version: @VERSION@
Libs: -L${libdir} -lgnaa @LIBS@ @XPM_LIBS@ @LIBICONV@
Cflags: -I${includedir} @XPM_CFLAGS@
extra: @INTVAR@

View File

@ -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

View File

@ -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'))