diff options
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 172e591522..d7d67fd508 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1060,27 +1060,23 @@ class RunQueueExecute: | |||
1060 | return | 1060 | return |
1061 | 1061 | ||
1062 | def fork_off_task(self, fn, task, taskname, quieterrors=False): | 1062 | def fork_off_task(self, fn, task, taskname, quieterrors=False): |
1063 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.get_file_appends(fn), self.cooker.configuration.data) | ||
1064 | 1063 | ||
1065 | env = bb.data.export_vars(the_data) | 1064 | envbackup = os.environ.copy() |
1066 | env = bb.data.export_envvars(env, the_data) | 1065 | env = {} |
1067 | 1066 | ||
1068 | taskdep = self.rqdata.dataCache.task_deps[fn] | 1067 | taskdep = self.rqdata.dataCache.task_deps[fn] |
1069 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']: | 1068 | if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']: |
1070 | envvars = the_data.getVar("FAKEROOTENV", True).split() | 1069 | envvars = (self.rqdata.dataCache.fakerootenv[fn] or "").split() |
1071 | for var in envvars: | 1070 | for var in envvars: |
1072 | comps = var.split("=") | 1071 | comps = var.split("=") |
1073 | env[comps[0]] = comps[1] | 1072 | env[comps[0]] = comps[1] |
1074 | fakedirs = (the_data.getVar("FAKEROOTDIRS", True) or "").split() | 1073 | |
1074 | fakedirs = (self.rqdata.dataCache.fakerootdirs[fn] or "").split() | ||
1075 | for p in fakedirs: | 1075 | for p in fakedirs: |
1076 | bb.mkdirhier(p) | 1076 | bb.mkdirhier(p) |
1077 | logger.debug(2, "Running %s:%s under fakeroot, state dir is %s" % (fn, taskname, fakedirs)) | 1077 | logger.debug(2, "Running %s:%s under fakeroot, state dir is %s" % (fn, taskname, fakedirs)) |
1078 | 1078 | for e in env: | |
1079 | envbackup = os.environ.copy() | 1079 | os.putenv(e, env[e]) |
1080 | for e in envbackup: | ||
1081 | os.unsetenv(e) | ||
1082 | for e in env: | ||
1083 | os.putenv(e, env[e]) | ||
1084 | 1080 | ||
1085 | sys.stdout.flush() | 1081 | sys.stdout.flush() |
1086 | sys.stderr.flush() | 1082 | sys.stderr.flush() |
@@ -1111,6 +1107,20 @@ class RunQueueExecute: | |||
1111 | # No stdin | 1107 | # No stdin |
1112 | newsi = os.open(os.devnull, os.O_RDWR) | 1108 | newsi = os.open(os.devnull, os.O_RDWR) |
1113 | os.dup2(newsi, sys.stdin.fileno()) | 1109 | os.dup2(newsi, sys.stdin.fileno()) |
1110 | |||
1111 | |||
1112 | the_data = bb.cache.Cache.loadDataFull(fn, self.cooker.get_file_appends(fn), self.cooker.configuration.data) | ||
1113 | |||
1114 | env2 = bb.data.export_vars(the_data) | ||
1115 | env2 = bb.data.export_envvars(env2, the_data) | ||
1116 | |||
1117 | for e in os.environ: | ||
1118 | os.unsetenv(e) | ||
1119 | for e in env2: | ||
1120 | os.putenv(e, env2[e]) | ||
1121 | for e in env: | ||
1122 | os.putenv(e, env[e]) | ||
1123 | |||
1114 | if quieterrors: | 1124 | if quieterrors: |
1115 | the_data.setVarFlag(taskname, "quieterrors", "1") | 1125 | the_data.setVarFlag(taskname, "quieterrors", "1") |
1116 | 1126 | ||
@@ -1137,7 +1147,8 @@ class RunQueueExecute: | |||
1137 | for e in env: | 1147 | for e in env: |
1138 | os.unsetenv(e) | 1148 | os.unsetenv(e) |
1139 | for e in envbackup: | 1149 | for e in envbackup: |
1140 | os.putenv(e, envbackup[e]) | 1150 | if e in env: |
1151 | os.putenv(e, envbackup[e]) | ||
1141 | 1152 | ||
1142 | return pid, pipein, pipeout | 1153 | return pid, pipein, pipeout |
1143 | 1154 | ||