summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-08-03 01:37:53 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-10 10:46:30 +0100
commit8efd48291166cc88da2b29005785c857d8065ace (patch)
tree69bb314ade6ff47b05e15258113ccd03e417b3e6 /meta/classes/package.bbclass
parent591bd6b0aa9dd95ccb68563e2631045a041eaa02 (diff)
downloadpoky-8efd48291166cc88da2b29005785c857d8065ace.tar.gz
package.bbclass: remove unneeded chmod() and chown()
* The mode and owner info are saved in inode, hardlink won't change them, so remove unneeded chmod() and chown(). * This can avoid the problem that when do_package re-run, the file's mode maybe different if it is 0444 (changed to 0644 when re-run), this is caused by pseudo adds 'w' on real file, and doesn't track linked source when hard link, Peter and Mark may fix pseudo, but the removed code is not needed, which can avoid the problem. * To reproduce the problem, for example, version.c from gzip's ${B}: 1) bitbake gzip 2) Edit rpm-native or package.bbclass to make do_package re-run. 3) bitbake gzip After the first build, build/version.c in gzip-dbg is 0444, but after the second build, it will be 0644, this because do_package does: $ ln ${B}/version.c gzip-dbg/version.c, $ chmod 0444 gzip-dbg/version.c (it runs chmod 0644 on the real filesystem) And in the second build, the gzip-dbg/version.c will be removed and created again, so that stat() can't get 0444 but 0644 since ${B}/version.c is not tracked by pseudo. (From OE-Core rev: 26ab4b431da0c00010e8d399f890c5fbf0b03c94) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass3
1 files changed, 0 insertions, 3 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index d6204cfee5..81acc10367 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1152,9 +1152,6 @@ python populate_packages () {
1152 fpath = os.path.join(root,file) 1152 fpath = os.path.join(root,file)
1153 if not cpath.islink(file): 1153 if not cpath.islink(file):
1154 os.link(file, fpath) 1154 os.link(file, fpath)
1155 fstat = cpath.stat(file)
1156 os.chmod(fpath, fstat.st_mode)
1157 os.chown(fpath, fstat.st_uid, fstat.st_gid)
1158 continue 1155 continue
1159 ret = bb.utils.copyfile(file, fpath) 1156 ret = bb.utils.copyfile(file, fpath)
1160 if ret is False or ret == 0: 1157 if ret is False or ret == 0: