Changeset 988 for vendor/current/buildtools/wafsamba/pkgconfig.py
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/buildtools/wafsamba/pkgconfig.py
r740 r988 1 1 # handle substitution of variables in pc files 2 2 3 import Build, sys, Logs 4 from samba_utils import * 3 import os, re, sys 4 import Build, Logs 5 from samba_utils import SUBST_VARS_RECURSIVE, TO_LIST 5 6 6 7 def subst_at_vars(task): 7 8 '''substiture @VAR@ style variables in a file''' 8 src = task.inputs[0].srcpath(task.env)9 tgt = task.outputs[0].bldpath(task.env)10 9 11 f = open(src, 'r') 12 s = f.read() 13 f.close() 10 s = task.inputs[0].read() 14 11 # split on the vars 15 12 a = re.split('(@\w+@)', s) … … 38 35 out.append(v) 39 36 contents = ''.join(out) 40 f = open(tgt, 'w') 41 s = f.write(contents) 42 f.close() 37 task.outputs[0].write(contents) 43 38 return 0 44 39 … … 54 49 source=f+'.in', 55 50 target=f) 51 bld.add_manual_dependency(bld.path.find_or_declare(f), bld.env['PREFIX']) 56 52 t.vars = [] 57 53 if t.env.RPATH_ON_INSTALL:
Note:
See TracChangeset
for help on using the changeset viewer.