mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +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@
|
Version: @VERSION@
|
||||||
Libs: -L${libdir} -lgnaa @LIBS@ @XPM_LIBS@ @LIBICONV@
|
Libs: -L${libdir} -lgnaa @LIBS@ @XPM_LIBS@ @LIBICONV@
|
||||||
Cflags: -I${includedir} @XPM_CFLAGS@
|
Cflags: -I${includedir} @XPM_CFLAGS@
|
||||||
|
extra: @INTVAR@
|
||||||
|
@ -13,7 +13,7 @@ def configure(conf):
|
|||||||
def build(bld):
|
def build(bld):
|
||||||
|
|
||||||
# the test.pc.in is a special case which is always handled
|
# 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(
|
tg = bld(
|
||||||
features = 'subst', # the feature 'subst' overrides the source/target processing
|
features = 'subst', # the feature 'subst' overrides the source/target processing
|
||||||
|
@ -701,8 +701,12 @@ class subst_pc(Task.Task):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
d = {}
|
d = {}
|
||||||
for x in lst:
|
for x in lst:
|
||||||
tmp = getattr(self.generator, x, '') or self.env.get_flat(x) or self.env.get_flat(x.upper())
|
tmp = getattr(self.generator, x, '') or self.env[x] or self.env[x.upper()]
|
||||||
d[x] = str(tmp)
|
try:
|
||||||
|
tmp = ''.join(tmp)
|
||||||
|
except TypeError:
|
||||||
|
tmp = str(tmp)
|
||||||
|
d[x] = tmp
|
||||||
|
|
||||||
code = code % d
|
code = code % d
|
||||||
self.outputs[0].write(code, encoding=getattr(self.generator, 'encoding', 'ISO8859-1'))
|
self.outputs[0].write(code, encoding=getattr(self.generator, 'encoding', 'ISO8859-1'))
|
||||||
|
Loading…
Reference in New Issue
Block a user