mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
devtool: refactor exec_fakeroot
Provide a function exec_fakeroot_no_d which does the same like exec_fakeroot does, but is usable independenlty from bitbake. This allows to use the fanction from scripts where the d variable is not available. (From OE-Core rev: 6f5980d96844559639fc3660bb975b0bdd1aa523) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
c9c0974209
commit
c17ce99a2f
|
@ -78,12 +78,15 @@ def exec_fakeroot(d, cmd, **kwargs):
|
||||||
"""Run a command under fakeroot (pseudo, in fact) so that it picks up the appropriate file permissions"""
|
"""Run a command under fakeroot (pseudo, in fact) so that it picks up the appropriate file permissions"""
|
||||||
# Grab the command and check it actually exists
|
# Grab the command and check it actually exists
|
||||||
fakerootcmd = d.getVar('FAKEROOTCMD')
|
fakerootcmd = d.getVar('FAKEROOTCMD')
|
||||||
|
fakerootenv = d.getVar('FAKEROOTENV')
|
||||||
|
exec_fakeroot_no_d(fakerootcmd, fakerootenv, cmd, kwargs)
|
||||||
|
|
||||||
|
def exec_fakeroot_no_d(fakerootcmd, fakerootenv, cmd, **kwargs):
|
||||||
if not os.path.exists(fakerootcmd):
|
if not os.path.exists(fakerootcmd):
|
||||||
logger.error('pseudo executable %s could not be found - have you run a build yet? pseudo-native should install this and if you have run any build then that should have been built')
|
logger.error('pseudo executable %s could not be found - have you run a build yet? pseudo-native should install this and if you have run any build then that should have been built')
|
||||||
return 2
|
return 2
|
||||||
# Set up the appropriate environment
|
# Set up the appropriate environment
|
||||||
newenv = dict(os.environ)
|
newenv = dict(os.environ)
|
||||||
fakerootenv = d.getVar('FAKEROOTENV')
|
|
||||||
for varvalue in fakerootenv.split():
|
for varvalue in fakerootenv.split():
|
||||||
if '=' in varvalue:
|
if '=' in varvalue:
|
||||||
splitval = varvalue.split('=', 1)
|
splitval = varvalue.split('=', 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user