From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] package.bbclass: Call os.chmod after os.mkdir
Date: Mon, 09 Sep 2013 00:03:43 +0100 [thread overview]
Message-ID: <1378681423.3484.101.camel@ted> (raw)
In-Reply-To: <1378652471-27278-1-git-send-email-Martin.Jansa@gmail.com>
On Sun, 2013-09-08 at 17:01 +0200, Martin Jansa wrote:
> * in 556dee0c4d6d8a87c0cddbd2f60fe5917d009f18 os.chmod was replaced by 2nd param
> to os.mkdir:
> - bb.utils.mkdirhier(dest)
> - fstat = os.stat(src)
> - os.chmod(dest, fstat.st_mode)
> + fstat = cpath.stat(src)
> + os.mkdir(dest, fstat.st_mode)
>
> but fstat in os.mkdir, doesn't work the same as good old os.chmod:
> >>> p='test-p'
> >>> os.mkdir(p, 041777)
> >>> oct(os.stat(p).st_mode)
> '041775'
> >>> os.chmod(p, 041777)
> >>> oct(os.stat(p).st_mode)
> '041777'
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> meta/classes/package.bbclass | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index bdac2bd..c96acd2 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -988,8 +988,9 @@ python populate_packages () {
> def mkdir(src, dest, p):
> src = os.path.join(src, p)
> dest = os.path.join(dest, p)
> + bb.utils.mkdirhier(dest)
> fstat = cpath.stat(src)
> - os.mkdir(dest, fstat.st_mode)
> + os.chmod(dest, fstat.st_mode)
> os.chown(dest, fstat.st_uid, fstat.st_gid)
> if p not in seen:
> seen.append(p)
Can we set and then restore the umask to avoid having to do this? I ask
since from what I remember, changing things like this is quite expensive
performance wise :(
Cheers,
Richard
prev parent reply other threads:[~2013-09-08 23:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-08 15:01 [PATCH] package.bbclass: Call os.chmod after os.mkdir Martin Jansa
2013-09-08 23:03 ` Richard Purdie [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=1378681423.3484.101.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=martin.jansa@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox