Openembedded Core Discussions
 help / color / mirror / Atom feed
* [OE-Core][PATCH v13 1/8] path.py: add support for ACLs and all additional attributes
@ 2023-08-17 12:46 Piotr Łobacz
  2023-08-17 12:46 ` [OE-Core][PATCH v13 2/8] package_ipk.bbclass: add support for ACLs and xattr Piotr Łobacz
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Piotr Łobacz @ 2023-08-17 12:46 UTC (permalink / raw)
  To: openembedded-core
  Cc: Piotr Łobacz via lists.openembedded.org, Piotr Łobacz

From: Piotr Łobacz via lists.openembedded.org <p.lobacz=welotec.com@lists.openembedded.org>

Extend `tar` command inside copytree() and copyhardlinktree() functions,
with additional parameters, in order to support ACLs and xattr. The posix
format doesn't need to be set in here, as GNU tar switches to it whenewer
is uses --acls and/or --xattrs parameters.

Additionaly change preservation of additional attributes for `cp` command
to all (meaning mode, ownership, timestamps etc.) not only xattrs, which
were previously.

Signed-off-by: Piotr Łobacz <p.lobacz@welotec.com>
---
 meta/lib/oe/path.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 0dc8f172d5..56e8e214ac 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -92,7 +92,7 @@ def copytree(src, dst):
     # This way we also preserve hardlinks between files in the tree.
 
     bb.utils.mkdirhier(dst)
-    cmd = "tar --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
+    cmd = "tar --acls --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --acls --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
     subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
 
 def copyhardlinktree(src, dst):
@@ -119,7 +119,7 @@ def copyhardlinktree(src, dst):
     if (canhard):
         # Need to copy directories only with tar first since cp will error if two 
         # writers try and create a directory at the same time
-        cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
+        cmd = "cd %s; find . -type d -print | tar --acls --xattrs --xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar --acls --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         source = ''
         if os.path.isdir(src):
@@ -130,7 +130,7 @@ def copyhardlinktree(src, dst):
         else:
             source = src
             s_dir = os.getcwd()
-        cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst))
+        cmd = 'cp -afl --preserve=all %s %s' % (source, os.path.realpath(dst))
         subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT)
     else:
         copytree(src, dst)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-09-06  7:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 12:46 [OE-Core][PATCH v13 1/8] path.py: add support for ACLs and all additional attributes Piotr Łobacz
2023-08-17 12:46 ` [OE-Core][PATCH v13 2/8] package_ipk.bbclass: add support for ACLs and xattr Piotr Łobacz
2023-08-22 15:58   ` Khem Raj
2023-08-22 17:03     ` Khem Raj
2023-08-23  0:25       ` Khem Raj
2023-08-23  1:00         ` Khem Raj
2023-09-06  7:16           ` Piotr Łobacz
2023-08-17 12:46 ` [OE-Core][PATCH v13 3/8] package.bbclass: " Piotr Łobacz
2023-08-17 12:46 ` [OE-Core][PATCH v13 4/8] sstate.bbclass: " Piotr Łobacz
2023-08-17 12:46 ` [OE-Core][PATCH v13 5/8] sstatesig.py: fix hash calculation for timestamp Piotr Łobacz
2023-08-17 13:33   ` Richard Purdie
2023-08-17 12:46 ` [OE-Core][PATCH v13 6/8] opkg-utils: add acl and xattr support Piotr Łobacz
2023-08-17 12:46 ` [OE-Core][PATCH v13 7/8] opkg: add options to enable support for acl and xattr Piotr Łobacz
2023-08-17 12:46 ` [OE-Core][PATCH v13 8/8] opkg: set locale from system environment variables Piotr Łobacz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox