* [PATCH] lib/oe/path: Fix tar invocation with --no-recursion
@ 2016-07-15 16:26 Clemens Lang
2016-07-21 19:45 ` Burton, Ross
0 siblings, 1 reply; 2+ messages in thread
From: Clemens Lang @ 2016-07-15 16:26 UTC (permalink / raw)
To: openembedded-core
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@bmw-carit.de>
---
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 413ebfb..9e238ea 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)
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
cmd = 'cd %s; find . -print0 | cpio --null -pdlu %s' % (src, dst)
check_output(cmd, shell=True, stderr=subprocess.STDOUT)
--
2.8.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lib/oe/path: Fix tar invocation with --no-recursion
2016-07-15 16:26 [PATCH] lib/oe/path: Fix tar invocation with --no-recursion Clemens Lang
@ 2016-07-21 19:45 ` Burton, Ross
0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2016-07-21 19:45 UTC (permalink / raw)
To: Clemens Lang; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
Hi Clemens,
On 15 July 2016 at 17:26, Clemens Lang <clemens.lang@bmw-carit.de> wrote:
> - 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)
>
I applied this manually as it's just a one-liner, but please do try to send
a patch based on master (the commit which caused this patch to not apply
was a week old when this was sent).
Ross
[-- Attachment #2: Type: text/html, Size: 1028 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-21 19:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 16:26 [PATCH] lib/oe/path: Fix tar invocation with --no-recursion Clemens Lang
2016-07-21 19:45 ` Burton, Ross
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.