From: Mark Hatle <mark.hatle@windriver.com>
To: <bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH 1/1] runqueue.py: Add umask task control
Date: Thu, 23 Jun 2011 20:11:40 -0500 [thread overview]
Message-ID: <4E03E44C.9040506@windriver.com> (raw)
In-Reply-To: <4E03CAB7.6030602@gmail.com>
On 6/23/11 6:22 PM, Khem Raj wrote:
> On 06/22/2011 10:57 AM, Mark Hatle wrote:
>> 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.)
>>
>> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
>> ---
>> lib/bb/build.py | 1 +
>> lib/bb/runqueue.py | 12 ++++++++++++
>> 2 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/lib/bb/build.py b/lib/bb/build.py
>> index 15ba956..4bbf10f 100644
>> --- a/lib/bb/build.py
>> +++ b/lib/bb/build.py
>> @@ -465,6 +465,7 @@ def add_tasks(tasklist, d):
>> getTask('nostamp')
>> getTask('fakeroot')
>> getTask('noexec')
>> + getTask('umask')
>> task_deps['parents'][task] = []
>> for dep in flags['deps']:
>> dep = data.expand(dep, d)
>> diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
>> index 1f3b54c..e455893 100644
>> --- a/lib/bb/runqueue.py
>> +++ b/lib/bb/runqueue.py
>> @@ -1063,8 +1063,17 @@ class RunQueueExecute:
>> # a fork() or exec*() activates PSEUDO...
>>
>> envbackup = {}
>> + umask = -1
>>
>> taskdep = self.rqdata.dataCache.task_deps[fn]
>> + if 'umask' in taskdep and taskname in taskdep['umask']:
>> + # umask might come in as a number or text string..
>> + try:
>> + umask = int(taskdep['umask'][taskname],8)
>> + except TypeError:
>> + umask = taskdep['umask'][taskname]
>> + logger.warning("Using umask 0%o %s, %s" % (umask, fn, taskname))
>> +
>
> this will be annoying. It should be made part of verbose messages though
That was a mistake, debugging message that ended up in the pull request.
>
>> if 'fakeroot' in taskdep and taskname in taskdep['fakeroot']:
>> envvars = (self.rqdata.dataCache.fakerootenv[fn] or "").split()
>> for key, value in (var.split('=') for var in envvars):
>> @@ -1103,6 +1112,9 @@ class RunQueueExecute:
>> newsi = os.open(os.devnull, os.O_RDWR)
>> os.dup2(newsi, sys.stdin.fileno())
>>
>> + if umask != -1:
>> + os.umask(umask)
>> +
>> bb.data.setVar("BB_WORKERCONTEXT", "1", self.cooker.configuration.data)
>> bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY", self, self.cooker.configuration.data)
>> bb.data.setVar("__RUNQUEUE_DO_NOT_USE_EXTERNALLY2", fn, self.cooker.configuration.data)
>
>
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
prev parent reply other threads:[~2011-06-24 1:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 17:57 [PATCH 0/1] Add the ability to specify a umask per task Mark Hatle
2011-06-22 17:57 ` [PATCH 1/1] runqueue.py: Add umask task control Mark Hatle
2011-06-22 17:49 ` Mark Hatle
2011-06-23 23:22 ` Khem Raj
2011-06-24 1:11 ` Mark Hatle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E03E44C.9040506@windriver.com \
--to=mark.hatle@windriver.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.