for x in fns:
file_path = os.path.join(envd_dir, x)
try:
- myconfig = getconfig(file_path)
+ myconfig = getconfig(file_path, expand=False)
except portage_exception.ParseError, e:
writemsg("!!! '%s'\n" % str(e), noiselevel=-1)
del e
del blacklisted, cfg
env_d = getconfig(
- os.path.join(target_root, "etc", "profile.env"))
+ os.path.join(target_root, "etc", "profile.env"), expand=False)
# env_d will be None if profile.env doesn't exist.
if env_d:
self.configdict["env.d"].update(env_d)
# We grab the latest profile.env here since it changes frequently.
self.configdict["env.d"].clear()
env_d = getconfig(
- os.path.join(self["ROOT"], "etc", "profile.env"))
+ os.path.join(self["ROOT"], "etc", "profile.env"), expand=False)
if env_d:
# env_d will be None if profile.env doesn't exist.
self.configdict["env.d"].update(env_d)
return 0
return 1
-def getconfig(mycfg,tolerant=0,allow_sourcing=False):
+def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True):
mykeys={}
try:
f=open(mycfg,'r')
raise portage_exception.CorruptionError("ParseError: Unexpected EOF: "+str(mycfg)+": line "+str(lex.lineno))
else:
return mykeys
- mykeys[key]=varexpand(val,mykeys)
+ if expand:
+ mykeys[key] = varexpand(val, mykeys)
+ else:
+ mykeys[key] = val
except SystemExit, e:
raise
except Exception, e: