]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
build: run fakeroot if FAKEROOT is set
authorChris Larson <chris_larson@mentor.com>
Fri, 8 Apr 2011 14:10:40 +0000 (07:10 -0700)
committerChris Larson <chris_larson@mentor.com>
Fri, 8 Apr 2011 14:30:39 +0000 (07:30 -0700)
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 <chris_larson@mentor.com>
lib/bb/build.py

index c81dd67fd523d19dfddcec5f3ade134f4e88d6eb..af43340e87aa8be4e3181df06114bd991a368223 100644 (file)
@@ -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)