diff options
Diffstat (limited to 'bitbake/bin/bitbake-worker')
-rwxr-xr-x | bitbake/bin/bitbake-worker | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 6ead2da6d1..115bc1d091 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
@@ -17,6 +17,8 @@ import signal | |||
17 | import pickle | 17 | import pickle |
18 | import traceback | 18 | import traceback |
19 | import queue | 19 | import queue |
20 | import shlex | ||
21 | import subprocess | ||
20 | from multiprocessing import Lock | 22 | from multiprocessing import Lock |
21 | from threading import Thread | 23 | from threading import Thread |
22 | 24 | ||
@@ -146,6 +148,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha | |||
146 | # a fork() or exec*() activates PSEUDO... | 148 | # a fork() or exec*() activates PSEUDO... |
147 | 149 | ||
148 | envbackup = {} | 150 | envbackup = {} |
151 | fakeroot = False | ||
149 | fakeenv = {} | 152 | fakeenv = {} |
150 | umask = None | 153 | umask = None |
151 | 154 | ||
@@ -165,6 +168,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha | |||
165 | 168 | ||
166 | # We can't use the fakeroot environment in a dry run as it possibly hasn't been built | 169 | # We can't use the fakeroot environment in a dry run as it possibly hasn't been built |
167 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run: | 170 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run: |
171 | fakeroot = True | ||
168 | envvars = (workerdata["fakerootenv"][fn] or "").split() | 172 | envvars = (workerdata["fakerootenv"][fn] or "").split() |
169 | for key, value in (var.split('=') for var in envvars): | 173 | for key, value in (var.split('=') for var in envvars): |
170 | envbackup[key] = os.environ.get(key) | 174 | envbackup[key] = os.environ.get(key) |
@@ -283,7 +287,11 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha | |||
283 | try: | 287 | try: |
284 | if dry_run: | 288 | if dry_run: |
285 | return 0 | 289 | return 0 |
286 | return bb.build.exec_task(fn, taskname, the_data, cfg.profile) | 290 | ret = bb.build.exec_task(fn, taskname, the_data, cfg.profile) |
291 | if fakeroot: | ||
292 | fakerootcmd = shlex.split(the_data.getVar("FAKEROOTCMD")) | ||
293 | subprocess.run(fakerootcmd + ['-S'], check=True, stdout=subprocess.PIPE) | ||
294 | return ret | ||
287 | except: | 295 | except: |
288 | os._exit(1) | 296 | os._exit(1) |
289 | if not profiling: | 297 | if not profiling: |