summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-06-22 15:10:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-24 12:23:12 +0100
commita1f79a7896b6411669b3ccada6204d2695e80fc5 (patch)
treed032e623fd249286bd8966c0409bb66f350638ac
parentd08a341af77ac0ad618d4033a18f33ac1fc98fb2 (diff)
downloadpoky-a1f79a7896b6411669b3ccada6204d2695e80fc5.tar.gz
runqueue.py: Add umask task control
The umask for a task can now be set as: task[umask] = 022 task[umask] = '022' If specified as a text string, it must be octal. (This is due to recipe parsing where it's always set to a string.) [RP tweaked to use None instead of -1] (Bitbake rev: a5caaaaba8f0db1af5d8f2e610021d6d4b56894e) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/build.py1
-rw-r--r--bitbake/lib/bb/runqueue.py11
2 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 7947906ab2..f69464c60b 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -463,6 +463,7 @@ def add_tasks(tasklist, d):
463 getTask('nostamp') 463 getTask('nostamp')
464 getTask('fakeroot') 464 getTask('fakeroot')
465 getTask('noexec') 465 getTask('noexec')
466 getTask('umask')
466 task_deps['parents'][task] = [] 467 task_deps['parents'][task] = []
467 for dep in flags['deps']: 468 for dep in flags['deps']:
468 dep = data.expand(dep, d) 469 dep = data.expand(dep, d)
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 7a17fce789..b801877e16 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1063,8 +1063,16 @@ class RunQueueExecute:
1063 # a fork() or exec*() activates PSEUDO... 1063 # a fork() or exec*() activates PSEUDO...
1064 1064
1065 envbackup = {} 1065 envbackup = {}
1066 umask = None
1066 1067
1067 taskdep = self.rqdata.dataCache.task_deps[fn] 1068 taskdep = self.rqdata.dataCache.task_deps[fn]
1069 if 'umask' in taskdep and taskname in taskdep['umask']:
1070 # umask might come in as a number or text string..
1071 try:
1072 umask = int(taskdep['umask'][taskname],8)
1073 except TypeError:
1074 umask = taskdep['umask'][taskname]
1075
1068 if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']: 1076 if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']:
1069 envvars = (self.rqdata.dataCache.fakerootenv[fn] or "").split() 1077 envvars = (self.rqdata.dataCache.fakerootenv[fn] or "").split()
1070 for key, value in (var.split('=') for var in envvars): 1078 for key, value in (var.split('=') for var in envvars):
@@ -1103,6 +1111,9 @@ class RunQueueExecute:
1103 newsi = os.open(os.devnull, os.O_RDWR) 1111 newsi = os.open(os.devnull, os.O_RDWR)
1104 os.dup2(newsi, sys.stdin.fileno()) 1112 os.dup2(newsi, sys.stdin.fileno())
1105 1113
1114 if umask:
1115 os.umask(umask)
1116
1106 bb.data.setVar("BB_WORKERCONTEXT", "1", self.cooker.configuration.data) 1117 bb.data.setVar("BB_WORKERCONTEXT", "1", self.cooker.configuration.data)
1107 bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, self.cooker.configuration.data) 1118 bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, self.cooker.configuration.data)
1108 bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY2", fn, self.cooker.configuration.data) 1119 bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY2", fn, self.cooker.configuration.data)