From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 5/6] sstate/lib.oe.path: Ensure file sparseness is preserved
Date: Tue, 14 Aug 2018 18:32:00 +0100 [thread overview]
Message-ID: <20180814173201.6723-5-richard.purdie@linuxfoundation.org> (raw)
In-Reply-To: <20180814173201.6723-1-richard.purdie@linuxfoundation.org>
Files when restored from sstate were missing their sparseness. Fix up various
functions to preserve this and make things more deterministic.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
meta/classes/sstate.bbclass | 4 ++--
meta/lib/oe/path.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index a091c6e843e..1c166ff6745 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -721,9 +721,9 @@ sstate_create_package () {
TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
# Use pigz if available
- OPT="-cz"
+ OPT="-czS"
if [ -x "$(command -v pigz)" ]; then
- OPT="-I pigz -c"
+ OPT="-I pigz -cS"
fi
# Need to handle empty directories
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index be02218c31d..1e24d0586b6 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -86,7 +86,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 - -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
+ cmd = "tar --xattrs --xattrs-include='*' -cf - -S -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
def copyhardlinktree(src, dst):
@@ -98,7 +98,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='*' -xhf - -C %s" % (src, src, dst)
+ 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)
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
source = ''
if os.path.isdir(src):
--
2.17.1
next prev parent reply other threads:[~2018-08-14 17:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 17:31 [PATCH 1/6] package_manager: Remove rpm specific pieces of create_packages_dir() Richard Purdie
2018-08-14 17:31 ` [PATCH 2/6] package_manager/sdk: Use filtered copies of the deploy ipk/deb directories Richard Purdie
2018-08-14 17:31 ` [PATCH 3/6] sstate: Ensure a given machine only removes things which it created Richard Purdie
2018-08-14 17:31 ` [PATCH 4/6] selftest: Replace bitbake -p with bitbake -e Richard Purdie
2018-08-14 17:32 ` Richard Purdie [this message]
2018-08-14 17:32 ` [PATCH 6/6] selftest/package: Improve test to cover sparseness and hardlinking from sstate Richard Purdie
2018-08-14 18:02 ` ✗ patchtest: failure for "package_manager: Remove rpm sp..." and 5 more Patchwork
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=20180814173201.6723-5-richard.purdie@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/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