Patchwork [1/1] package.bbclass: ensure correct modes on directories

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date July 17, 2014, 2:08 a.m.
Message ID <8a2f5d0e429d76a916afc1177cd0d74acadc20f0.1405562859.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/75871/
State New
Headers show

Comments

Qi.Chen@windriver.com - July 17, 2014, 2:08 a.m.
Previously, when we create directories in populate_packages, the
directory modes are not all correct. Take the base-files recipe
as an example. The directory package/home has mode 2755, but
packages-split/base-files/home has mode 0755.

So after using creating directory, we need to use chmod to ensure
it gets the correct mode.

[YOCTO #6517]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/package.bbclass |    1 +
 1 file changed, 1 insertion(+)
Richard Purdie - July 18, 2014, 1:31 p.m.
On Thu, 2014-07-17 at 10:08 +0800, Chen Qi wrote:
>                  fstat = cpath.stat(src)
>                  os.mkdir(dest, fstat.st_mode)
> +                os.chmod(dest, fstat.st_mode)

This doesn't make sense. Shouldn't the fstat.st_mode to os.mkdir have
taken care of the mode for us?

Cheers,

Richard

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 26a20d1..7e85af4 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1019,6 +1019,7 @@  python populate_packages () {
                 dest = os.path.join(dest, p)
                 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)