# execute function
prevdir = os.getcwd()
- ret = os.system('sh -e %s' % runfile)
+ if data.getVarFlag(func, "fakeroot", d):
+ maybe_fakeroot = 'fakeroot '
+ else:
+ maybe_fakeroot = ''
+ ret = os.system('%ssh -e %s' % (maybe_fakeroot, runfile))
os.chdir(prevdir)
# restore the backups
def inheritFromOS(d = _data):
"""Inherit variables from the environment."""
+ # fakeroot needs to be able to set these
+ non_inherit_vars = [ "LD_LIBRARY_PATH", "LD_PRELOAD" ]
for s in os.environ.keys():
- try:
- setVar(s, os.environ[s], d)
- except TypeError:
- pass
+ if not s in non_inherit_vars:
+ try:
+ setVar(s, os.environ[s], d)
+ except TypeError:
+ pass
import sys, string
from oe.parse.ConfHandler import include, localpath, obtain, init
-__func_start_regexp__ = re.compile( r"((?P<py>python)\s*)*(?P<func>\w+)\s*\(\s*\)\s*{$" )
+__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>\w+)\s*\(\s*\)\s*{$" )
__inherit_regexp__ = re.compile( r"inherit\s+(.+)" )
__export_func_regexp__ = re.compile( r"EXPORT_FUNCTIONS\s+(.+)" )
__addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
# clean up old version of this piece of metadata, as its
# flags could cause problems
data.setVarFlag(key, 'python', None, d)
+ data.setVarFlag(key, 'fakeroot', None, d)
if m.group("py") is not None:
data.setVarFlag(key, "python", "1", d)
else:
data.setVarFlag(key, "python", None, d)
+ if m.group("fr") is not None:
+ data.setVarFlag(key, "fakeroot", "1", d)
+ else:
+ data.setVarFlag(key, "fakeroot", None, d)
return
m = __export_func_regexp__.match(s)