]> code.ossystems Code Review - openembedded-core.git/commitdiff
meta/lib/oe/package.py: fix files ownership in packages
authorFabrice Coulon <fabrice.coulon@axis.com>
Thu, 14 May 2015 18:01:40 +0000 (19:01 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 May 2015 17:13:17 +0000 (18:13 +0100)
This fix solves the problem with the ownership of files in packages.
The do_install task was producing correct and expected output but when
the files were being put in, e.g. a rpm package, the ownership could
be different than that in the do_install task.

[YOCTO #7428]

(From OE-Core master rev: 1a50cc5aeafff0d8ee6c4a41dd2770ecd31455f0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Fabrice Coulon <fabrice.coulon@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package.py

index a26a631837c571ef84361647a339f5f54730fdbe..db8dc28fd3704df01549a05cd6a0528350d56832 100644 (file)
@@ -31,7 +31,7 @@ def runstrip(arg):
         extraflags = "--remove-section=.comment --remove-section=.note"
 
     # Use mv to break hardlinks
-    stripcmd = "'%s' %s '%s' -o '%s.tmp' && mv '%s.tmp' '%s'" % (strip, extraflags, file, file, file, file)
+    stripcmd = "'%s' %s '%s' -o '%s.tmp' && chown --reference='%s' '%s.tmp' && mv '%s.tmp' '%s'" % (strip, extraflags, file, file, file, file, file, file)
     bb.debug(1, "runstrip: %s" % stripcmd)
 
     ret = subprocess.call(stripcmd, shell=True)