]> 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, 12 Mar 2015 14:36:55 +0000 (15:36 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Mar 2015 10:59:05 +0000 (10:59 +0000)
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]

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>
meta/lib/oe/package.py

index 7c728fcd231c426e6e7d489eeb64ac18c9122a88..8bc56c6e88eb138ed36774c8628934c4e8613cd3 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)