From: Chris Larson Date: Fri, 8 Apr 2011 14:10:40 +0000 (-0700) Subject: build: run fakeroot if FAKEROOT is set X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00403c4d5a05b9188df303b08fa8e1e58efd27b0;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git build: run fakeroot if FAKEROOT is set FAKEROOT contains the fakeroot command to be run. This should not be set for those using pseudo + FAKEROOTENV, but should be set for people like upstream OE, and its value should be 'fakeroot' for them, for compatibility with the old mechanisms. Signed-off-by: Chris Larson --- diff --git a/lib/bb/build.py b/lib/bb/build.py index c81dd67fd52..af43340e87a 100644 --- a/lib/bb/build.py +++ b/lib/bb/build.py @@ -28,6 +28,7 @@ import os import sys import logging +import shlex import bb import bb.msg import bb.process @@ -152,8 +153,6 @@ def exec_func(func, d, dirs = None): adir = None ispython = flags.get('python') - if flags.get('fakeroot') and not flags.get('task'): - bb.fatal("Function %s specifies fakeroot but isn't a task?!" % func) lockflag = flags.get('lockfiles') if lockflag: @@ -232,6 +231,10 @@ def exec_func_shell(function, d, runfile, cwd=None): os.chmod(runfile, 0775) cmd = runfile + if d.getVarFlag(function, 'fakeroot'): + fakerootcmd = d.getVar('FAKEROOT', True) + if fakerootcmd: + cmd = [fakerootcmd, runfile] if logger.isEnabledFor(logging.DEBUG): logfile = LogTee(logger, sys.stdout)