]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/path: Fix performance issue got copyhardlinktree()
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 8 Nov 2013 15:19:05 +0000 (15:19 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 12 Nov 2013 10:14:10 +0000 (10:14 +0000)
With the directory copy was added to avoid race issues, it wasn't noticed that
tar was recursing the directories and copying files too. This is completely
crazy when we hardlink those files in the next command.

Resolve the issue by telling tar not to recurse. This gives a significant
performance boost to various parts of the system (do_package for linux-yocto
256s -> 178s for example).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/path.py

index 1310e38fe193b77699018b4429ec9ba469699fae..d0588baf1500cf7d31319020fff06fe0b9095d65 100644 (file)
@@ -93,7 +93,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 -cf - -C %s -p --files-from - | tar -xf - -C %s' % (src, src, dst)
+        cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
         check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         if os.path.isdir(src):
             src = src + "/*"