multiple files instead of being confined to a single file. This allows
profiles to create incremental-like behavior with non-incremental variables
when desired.
svn path=/main/trunk/; revision=10293
self.make_defaults_use = []
self.mygcfg = {}
if self.profiles:
- mygcfg_dlists = [getconfig(os.path.join(x, "make.defaults")) \
- for x in self.profiles]
+ mygcfg_dlists = []
+ var_map = {}
+ for x in self.profiles:
+ var_map = getconfig(os.path.join(x, "make.defaults"),
+ expand=var_map)
+ mygcfg_dlists.append(var_map)
+
for cfg in mygcfg_dlists:
if cfg:
self.make_defaults_use.append(cfg.get("USE", ""))
return (newfile, StringIO.StringIO())
def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
- mykeys={}
+ if isinstance(expand, dict):
+ # Some existing variable definitions have been
+ # passed in, for use in substitutions.
+ mykeys = expand.copy()
+ expand = True
+ else:
+ mykeys = {}
try:
f=open(mycfg,'r')
except IOError, e: