public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 2/6] oe/path.py: copyhardlinktree: don't overwrite existing symlinks
Date: Tue, 10 Dec 2019 19:34:21 +0100	[thread overview]
Message-ID: <3caf5b70bab647303e44ec149f8b999bce659ec0.1576002865.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1576002865.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1576002865.git.jan.kiszka@siemens.com>

From: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>

Before GNU tar 1.24, only the archive creation command had the '-h'
argument to preserve and follow symlinks. After >= 1.24 via commit
14efeb9f956e38d7be (tar: --dereference consistency) the capability to
preserve symlinks was also added to the archive extraction command.

-h is default at archive creation but is not default at extraction,
meaning that it will replace symlinks with directories even if the
original filesystem directory tree and archive contains them.

Add -h to the copyhardlinktree extraction step so the build can
support symlinks in variables like ${DEPLOY_DIR_IPK/RPM/DEB}.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
[Jan: imported from OE-core c1b73fe26540c38086e259be6eb313e0826dceed]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/lib/oe/path.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 410738b..515153d 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -102,7 +102,7 @@ def copyhardlinktree(src, dst):
     if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
         # 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 - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, src, dst)
+        cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         source = ''
         if os.path.isdir(src):
-- 
2.16.4


  parent reply	other threads:[~2019-12-10 18:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 18:34 [PATCH 0/6] OE alignments, including patch.bbclass Jan Kiszka
2019-12-10 18:34 ` [PATCH 1/6] lib/oe/path.py: Add GPLv2 header Jan Kiszka
2019-12-10 18:34 ` Jan Kiszka [this message]
2019-12-10 18:34 ` [PATCH 3/6] lib/oe/path.py: Align with OE-core regarding sparseness preservation Jan Kiszka
2019-12-10 18:34 ` [PATCH 4/6] lib/oe/terminal.py: fix gnome-terminal start behavior Jan Kiszka
2019-12-10 18:34 ` [PATCH 5/6] oe.types.path: Use with to control file handle lifetime Jan Kiszka
2019-12-10 18:34 ` [PATCH 6/6] patch: Replace custom implementation with OE-core solution Jan Kiszka
2019-12-11 14:16   ` Jan Kiszka
2019-12-11 14:21   ` Baurzhan Ismagulov
2019-12-11 14:26     ` Jan Kiszka
2019-12-27 12:50 ` [PATCH 0/6] OE alignments, including patch.bbclass Baurzhan Ismagulov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3caf5b70bab647303e44ec149f8b999bce659ec0.1576002865.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox