From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [RFC PATCH 2/3] lib/bb/siggen.py: create permissive files and directories
Date: Thu, 10 May 2012 12:22:24 +0100 [thread overview]
Message-ID: <1336648944.2494.128.camel@ted> (raw)
In-Reply-To: <4048abda9d53e155e0802663af9c78f542499e8e.1336608479.git.josh@linux.intel.com>
On Wed, 2012-05-09 at 17:22 -0700, Joshua Lock wrote:
> Create signature files, and the directories which contain them, with
> rwx for everyone so that they are easily shared with different users
> of the same machine.
>
> Signed-off-by: Joshua Lock <josh@linux.intel.com>
> ---
> bitbake/lib/bb/siggen.py | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
> index 8c79b17..bd6d59b 100644
> --- a/bitbake/lib/bb/siggen.py
> +++ b/bitbake/lib/bb/siggen.py
> @@ -201,7 +201,12 @@ class SignatureGeneratorBasic(SignatureGenerator):
> for dep in data['runtaskdeps']:
> data['runtaskhashes'][dep] = self.taskhash[dep]
>
> - p = pickle.Pickler(file(sigfile, "wb"), -1)
> + # Create file with permissive (0777) read/write for easier sharing
> + f = os.fdopen(os.open(sigfile, os.O_RDWR|os.O_CREAT), "wb")
> + # os.open() and os.fdopen() are affected by the users umask so brute force
> + # the permissions with a call to chmod
> + os.chmod(sigfile, 0777)
> + p = pickle.Pickler(f, -1)
> p.dump(data)
Why not just run the chmod after the original pickle code? Its not as if
you avoid a race this way :/.
Cheers,
Richard
next prev parent reply other threads:[~2012-05-10 11:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 0:22 [RFC PATCH 0/3] Shared state for all ! Joshua Lock
2012-05-10 0:22 ` [RFC PATCH 1/3] lib/bb/utils.py: add optional mode parameter to bb.utils.mkdirhier() Joshua Lock
2012-05-10 11:19 ` Richard Purdie
2012-05-10 0:22 ` [RFC PATCH 2/3] lib/bb/siggen.py: create permissive files and directories Joshua Lock
2012-05-10 11:22 ` Richard Purdie [this message]
2012-05-10 16:10 ` Joshua Lock
2012-05-10 0:22 ` [RFC PATCH 3/3] sstate.bbclass: ensure sstate files are easily shared Joshua Lock
2012-05-10 0:27 ` Saul Wold
2012-05-10 1:01 ` Joshua Lock
2012-05-10 0:50 ` [RFC PATCH 0/3] Shared state for all ! Chris Larson
2012-05-10 1:05 ` Joshua Lock
2012-05-10 2:15 ` Chris Larson
2012-05-10 2:32 ` Joshua Lock
2012-05-10 3:10 ` Joshua Lock
2012-05-10 3:14 ` Joshua Lock
2012-05-10 5:16 ` Khem Raj
2012-05-10 16:12 ` Joshua Lock
2012-05-10 16:31 ` Khem Raj
2012-05-10 7:25 ` Koen Kooi
2012-05-10 16:05 ` Joshua Lock
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=1336648944.2494.128.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@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.