From: Saul Wold <sgw@linux.intel.com>
To: Jason Plum <jplum@devonit.com>, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] lib/oe: copyhardlinktree - detect mount points Add function getmount to detect the mount point of the path, as os.stat(path).st_dev in copyhardlinktree fails in lxc containers to detect different paths as separate mounted filesystems (cp -l failure)
Date: Fri, 17 Jan 2014 13:34:00 -0800 [thread overview]
Message-ID: <52D9A1C8.7040400@linux.intel.com> (raw)
In-Reply-To: <1389910093-8950-1-git-send-email-jplum@devonit.com>
On 01/16/2014 02:08 PM, Jason Plum wrote:
> Signed-off-by: Jason Plum <jplum@devonit.com>
> ---
> meta/lib/oe/path.py | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
This patch did not apply cleanly, it's possible you patched against an
older version of master.
> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
> index 1310e38..f1905c3 100644
> --- a/meta/lib/oe/path.py
> +++ b/meta/lib/oe/path.py
> @@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
> if os.path.isdir(src) and not len(os.listdir(src)):
> return
>
> - if (os.stat(src).st_dev == os.stat(dst).st_dev):
> + if (getmount(src) == getmount(dst)):
Can you measure the affect on build time with this change?
> # 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 -cf - -C %s -p --files-from - | tar -xf - -C %s' % (src, src, dst)
> @@ -259,3 +259,12 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False)
> raise
>
> return file
> +
> +def getmount(path):
> + """ Returns the mount point of the path, using realpath """
> + path = realpath(path)
In current master, realpath() seems to need 2 args:
Exception: TypeError: realpath() takes at least 2 arguments (1 given)
Sau!
> + while path != os.path.sep:
> + if os.path.ismount(path):
> + return path
> + path = os.path.abspath(os.path.join(path, os.pardir))
> + return path
>
prev parent reply other threads:[~2014-01-17 21:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 22:08 [PATCH] lib/oe: copyhardlinktree - detect mount points Add function getmount to detect the mount point of the path, as os.stat(path).st_dev in copyhardlinktree fails in lxc containers to detect different paths as separate mounted filesystems (cp -l failure) Jason Plum
2014-01-17 21:34 ` Saul Wold [this message]
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=52D9A1C8.7040400@linux.intel.com \
--to=sgw@linux.intel.com \
--cc=jplum@devonit.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.