From patchwork Sun Oct 15 11:23:29 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: =?utf-8?q?Piotr_=C5=81obacz?=
X-Patchwork-Id: 32272
Return-Path:
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org
(localhost.localdomain [127.0.0.1])
by smtp.lore.kernel.org (Postfix) with ESMTP id 542E5CDB494
for ; Sun, 15 Oct 2023 15:06:28 +0000 (UTC)
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
(EUR02-DB5-obe.outbound.protection.outlook.com [40.107.249.60])
by mx.groups.io with SMTP id smtpd.web11.90066.1697369032343148425
for ;
Sun, 15 Oct 2023 04:23:54 -0700
Authentication-Results: mx.groups.io;
dkim=fail reason="dkim: body hash did not verify" header.i=@welotec.com
header.s=selector1 header.b=WYAAeKAg;
spf=pass (domain: welotec.com, ip: 40.107.249.60,
mailfrom: p.lobacz@welotec.com)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=IExahFqQ/LVQXaqUtBQiM8lEJIZCLB19yz4RMMGTYQ3UVMXxbnPeT6NQ2JVGwXT59U616ZZYZRrrKQoPQj90Nd2AwBgPtOvo56eUTXzGOwk49YbzhPkLZt8ce3ifh4XDsS6B8surW3uU+ObVNj6Y06G0V828XFrqIXAB5SwYGfUENwep6Wq6imvya9blZRXR+5AvuAbHZ2E8XJw7gUhoyXJyb9NzlKGbntuw4hTHzE0W6e+B8cA7JjT4DbmL1SzTrgEdwiBALRcEDAxaEGYqpTEq1qVgdr2SETBXAs1DYoqJTxzDBbNT6x249Di+XFIwejVluTAlUgmynyBPeBEyjQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=s/uswOqNFOt1x08C3lwLsvp20EExQ/4R5pDoEM+lNso=;
b=Rwz//tA2OSLSTEsHDceLKSI6hNGqee59tpHRiA9v80WYi714hbDXX51WuYibHNOhlOlWSUaJQfebbF8iUXMCDA4Tjklr5tstZ+PEqawDo2WLt9u1wCKfdXrmARUuBDyQZWePywixyli7aDIy/scoP9RxNKtp9PkjfQ6NGBA6J0nfwmA5Z8PdPBHT3DjxEjPpGD1FQx6YyC6lhYi7HWk0Ch9FQCIWjqtXo9YSBZijLtzLZPP1hFpPz7N6tz4EbWORSzr+BbN9vQTxwrJp+L0u0pXHRas09hrrEypPIhigk7Oxaml1P/mFBHBW8fHb1CPrdAFeDtmI8m3Vcg45ZWbL6w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=welotec.com; dmarc=pass action=none header.from=welotec.com;
dkim=pass header.d=welotec.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=welotec.com;
s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=s/uswOqNFOt1x08C3lwLsvp20EExQ/4R5pDoEM+lNso=;
b=WYAAeKAgoRNI/QhkkttxgBl3oTSEecVmjL5ROStn/4gqTiiScqxBcDrFhoCOmbc5lFK+JtoqS3BljabKnhQ2MCfzfCzfj6f74j02A8cqacPFPv6G83pVCgSaPpH9pqKxVoX2Ie58188QMO/Yrs5umlb8pF4tvxEP+lyfAhT93O8d+QtC9bH6J5NKJxnQb+gsiSunRWgFmcCkwarcSJnl234AkIhXGph5PbitA5py5ZD1xvoLXR0ow9N/ldk8B5+mVtahX2U4ayA+e/9TxA7RbaYyri/Ltn5gxfTOggSUvMjnsMNMYe3jRJRTRYWsFfNNclyVPR+ixDYtRfiC0AO8uw==
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=welotec.com;
Received: from VI1PR04MB5373.eurprd04.prod.outlook.com (2603:10a6:803:da::22)
by AM9PR04MB8113.eurprd04.prod.outlook.com (2603:10a6:20b:3b5::7) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.47; Sun, 15 Oct
2023 11:23:50 +0000
Received: from VI1PR04MB5373.eurprd04.prod.outlook.com
([fe80::3090:4af6:ae14:b9c3]) by VI1PR04MB5373.eurprd04.prod.outlook.com
([fe80::3090:4af6:ae14:b9c3%6]) with mapi id 15.20.6886.034; Sun, 15 Oct 2023
11:23:50 +0000
From: =?utf-8?q?Piotr_=C5=81obacz?=
To: openembedded-devel@lists.openembedded.org
CC: =?utf-8?q?Piotr_=C5=81obacz?=
Subject: [OE-Core][PATCH v14 04/11] path.py: add support for ACLs and all
additional attributes
Date: Sun, 15 Oct 2023 13:23:29 +0200
Message-ID: <20231015112336.55722-4-p.lobacz@welotec.com>
X-Mailer: git-send-email 2.42.0
In-Reply-To: <20231015112336.55722-1-p.lobacz@welotec.com>
References: <20231015112336.55722-1-p.lobacz@welotec.com>
X-ClientProxiedBy: FR3P281CA0100.DEUP281.PROD.OUTLOOK.COM
(2603:10a6:d10:a1::18) To VI1PR04MB5373.eurprd04.prod.outlook.com
(2603:10a6:803:da::22)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: VI1PR04MB5373:EE_|AM9PR04MB8113:EE_
X-MS-Office365-Filtering-Correlation-Id: 5f7ab475-2ce7-4862-399b-08dbcd713477
X-MS-Exchange-AtpMessageProperties: SA
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info:
FuNzlhxeifEYmvtth6K67sQErhuiNiV0DYqiZcwlzkWrtGmzrCBG3AIgPWEu24cdLpKZPlwsIy1nE6vhR2oci6j8yafsvWl3wO6sjde1V1V/9RG7nhfI2YkV39fqqirgw7EieCAUmefHFP3uCTvrimePL0XIO4XIJ8OXY3681HLHl8WZzwxVrrODZD4Xs1mJwjzMWvAxWlnOaCttqIQPVeBEx3m3LHox9LwLO5VX2sQ1/Xni2JAW5YMMKxVxGV58pBgu2WrK0pM54ondLvHqnXR33d8JO49iEAvnomy08GwOz9MwDi5wz2DsqsgyfCCuHSHJRc+L5RapgCGLkyEFRnQp1zSG+hAwJ9rpSLSm1qu2zYFq5N2WWz9dtWUGo8mvpk/CY4SlYKMXno8v9ei8jDwhaNqDwQGqgCuYQCqOHYu80vljjqiXf/nibywJpWfztcRjuXLEbFSwE5ZqchNn+sob0hG7NkdBlP79KEpHpDulHna9+SH/sQsuR5R2SnFKLzG5jQS6Cv37Tc7Xe4mV0NBsoBv9ID1bQUbT/XImlKUhTN7+MViLmIvOAqEmmllC9b23CAHILvNdYohu2IHxXIUX9QxTgzazuQFj10FVLRMPRpvz+/o+/+W/FOflEalT
X-Forefront-Antispam-Report:
CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5373.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(376002)(346002)(396003)(39830400003)(186009)(1800799009)(451199024)(64100799003)(478600001)(6486002)(66946007)(6916009)(66476007)(66556008)(6666004)(83380400001)(86362001)(38100700002)(316002)(6512007)(66574015)(26005)(1076003)(107886003)(52116002)(6506007)(2616005)(5660300002)(41300700001)(36756003)(8936002)(8676002)(4326008)(38350700005)(2906002);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
Vu47PQ7lLz5jKiVqpJmooxd2oLxP77nys42Uk0mNfwwnoGRMV7KqFfa7fnhKH6t4gRPFRhDMvhAGQLv1aCMmUhSVJkTc2AINnsWnxxIxMUk5Nt0ptPYTQlSVcOhs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CJazvtNydOVYsJ2g0qaGzGRaPB1J/PkrMxF7pLewOsS7AaEtNI2VLaZ6grdX6EyxpkNHtSl0gvMJaKNfOq9yd3hRRck4pBG5dqrjoLQ4DebLg/2iG5ck9q1DcjqroFjrz5TEXSL6DkMqe5Rt5bWCuMxtFd9YOfnooIaHo3oCyfeIANqvVvo6cUHVfdl8dComFGjeYTTLlbW7ZsLI7C+Py7TwcoY0raNuhPWUfMdZWNTRs6YuHb1Ui63EWBYtAFl6Uwqk7Gfc5el8LHUtJuAu/FZiV54/fUR4a5914Pzyh9B+N66XyG3Uerd4kQPAuLu4sKjZ4qUQYdHYFQghCQEIo87rNGnfLFgtYQsEMlm6Ao03bRY7DLdf3h/8AfQCT8JXqzYeXo
X-OriginatorOrg: welotec.com
X-MS-Exchange-CrossTenant-Network-Message-Id:
5f7ab475-2ce7-4862-399b-08dbcd713477
X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5373.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2023 11:23:50.0110
(UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 25111a7f-1d5a-4c51-a4ca-7f8e44011b39
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName:
Nx5W+eLdSNM7lwuMgN+aCpziYqBzrcYin7pc+ACKsSEWwLOwnR2eaakccK0LeKKMbrUaR9XKOJ5ZcZOBMdIFJA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8113
List-Id:
X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by
aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for
; Sun, 15 Oct 2023 15:06:28 -0000
X-Groupsio-URL:
https://lists.openembedded.org/g/openembedded-devel/message/105532
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
---
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)