[oe-commits] [openembedded-core] 44/72: lib/oe/path: Fix tar invocation with --no-recursion

git at git.openembedded.org git at git.openembedded.org
Mon Jul 25 22:53:12 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit d45f5e71fef5ffbd4408f69c5c179dc71a3eb452
Author: Clemens Lang <clemens.lang at bmw-carit.de>
AuthorDate: Fri Jul 15 18:26:26 2016 +0200

    lib/oe/path: Fix tar invocation with --no-recursion
    
    tar's --no-recursion flag only applies to files mentioned after the
    flag, which made it a no-op in this invocation of tar, because it was at
    the end of the command line.
    
    This is simple to verify with GNU tar 1.29:
    
    | $ mkdir foo
    | $ mkdir foo/dir
    | $ touch foo/dir/file
    | $ tar -cf - foo --no-recursion | tar t
    | foo/
    | foo/dir/
    | foo/dir/file
    | $ tar -cf - --no-recursion foo | tar t
    | foo/
    
    Modify the code so that it actually does what the comment says by moving
    the flag in front of the --files-from argument.
    
    Signed-off-by: Clemens Lang <clemens.lang at bmw-carit.de>
    Signed-off-by: Ross Burton <ross.burton at intel.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 dbba60a..3c07df3 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -77,7 +77,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 - --no-recursion | tar -xf - -C %s' % (src, src, dst)
+        cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --no-recursion --files-from - | tar -xf - -C %s' % (src, src, dst)
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
         cmd = 'cd %s; find . -print0 | cpio --null -pdlu %s' % (src, dst)
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list