[OE-core] [PATCH v3] meta/oe/lib/path.py - check mount points, not device
Saul Wold
sgw at linux.intel.com
Tue Jan 28 18:47:23 UTC 2014
On 01/20/2014 11:22 AM, Jason Plum wrote:
> Signed-off-by: Jason Plum <jplum at devonit.com>
> ---
> meta/lib/oe/path.py | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
This patch is still not applying cleanly to master, I am also still a
little concerned if this will affect performance since it's used often
in sstate code.
Have you compared build times with and without this patch?
Sau!
> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
> index 46783f8..dab20fc 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)):
> # 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 - --no-recursion | tar -xf - -C %s' % (src, src, dst)
> @@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False)
> raise
>
> return file
> +
> +def getmount(path):
> + """ getmount takes a path parameter, uses os.path.realpath with os.path.abspath to
> + handle symlink resolution, and returns the path to the mount point of the input path
> + """
> + path = os.path.realpath(os.path.abspath(path))
> + while path != os.path.sep:
> + if os.path.ismount(path):
> + return path
> + path = os.path.abspath(os.path.join(path, os.pardir))
> + return path
> \ No newline at end of file
>
More information about the Openembedded-core
mailing list