From c17ce99a2fd6bf95543f3559b847cf98c34d4563 Mon Sep 17 00:00:00 2001 From: Adrian Freihofer Date: Mon, 22 Jan 2024 14:58:23 +0100 Subject: 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 Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- scripts/lib/devtool/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/lib') diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index b4f998a5bc..c7fc3cfc41 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -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""" # Grab the command and check it actually exists 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): 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 # Set up the appropriate environment newenv = dict(os.environ) - fakerootenv = d.getVar('FAKEROOTENV') for varvalue in fakerootenv.split(): if '=' in varvalue: splitval = varvalue.split('=', 1) -- cgit v1.2.3-54-g00ecf