mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
Issue 1164
This commit is contained in:
parent
6ecaf793a9
commit
440fd37dfa
@ -1,5 +1,5 @@
|
||||
Name: test
|
||||
Description: bork bork bork!
|
||||
Description: ПРИЛОЖЕНИЕ
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lgnaa @LIBS@ @XPM_LIBS@ @LIBICONV@
|
||||
Cflags: -I${includedir} @XPM_CFLAGS@
|
||||
|
@ -18,6 +18,7 @@ def build(bld):
|
||||
features = 'subst', # the feature 'subst' overrides the source/target processing
|
||||
source = 'foo.in', # list of string or nodes
|
||||
target = 'foo.txt', # list of strings or nodes
|
||||
encoding = 'ascii', # file encoding for python3, default is ISO8859-1
|
||||
install_path = '/tmp/uff/', # installation path, optional
|
||||
chmod = Utils.O755, # installation mode, optional
|
||||
PREFIX = bld.env.PREFIX, # variables to use in the substitution
|
||||
|
@ -665,7 +665,11 @@ class subst_pc(Task.Task):
|
||||
os.chmod(self.outputs[0].abspath(), self.generator.chmod)
|
||||
return
|
||||
|
||||
code = self.inputs[0].read()
|
||||
code = self.inputs[0].read('rb')
|
||||
try:
|
||||
code = code.decode(getattr(self.generator, 'encoding', 'ISO8859-1'))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
# replace all % by %% to prevent errors by % signs
|
||||
code = code.replace('%', '%%')
|
||||
@ -688,7 +692,12 @@ class subst_pc(Task.Task):
|
||||
tmp = getattr(self.generator, x, '') or self.env.get_flat(x) or self.env.get_flat(x.upper())
|
||||
d[x] = str(tmp)
|
||||
|
||||
self.outputs[0].write(code % d)
|
||||
try:
|
||||
code = code.encode(getattr(self.generator, 'encoding', 'ISO8859-1'))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
self.outputs[0].write(code, 'wb')
|
||||
self.generator.bld.raw_deps[self.uid()] = self.dep_vars = lst
|
||||
|
||||
# make sure the signature is updated
|
||||
|
Loading…
Reference in New Issue
Block a user