diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2017-03-14 01:45:45 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-17 16:53:05 +0000 |
commit | 08dfb8930158a2b34d530ea188f757a4a81b55c1 (patch) | |
tree | 4678b2d9752b8864de32415e9f60b1541ac16e02 /meta/lib/oe/path.py | |
parent | 8c1ac497da2a5f2567a1317de975cb5b98160be3 (diff) | |
download | poky-08dfb8930158a2b34d530ea188f757a4a81b55c1.tar.gz |
oe/path.py: fix for "Argument list too long"
Issue: LIN9-1648
Fixed when len(TMPDIR) = 410:
$ bitbake core-image-sato-sdk
[snip]
Subprocess output:
/bin/sh: /bin/cp: Argument list too long
ERROR: core-image-sato-sdk-1.0-r0 do_rootfs: Function failed: do_rootfs
[snip]
This is because "copyhardlinktree(src, dst)" does "cp -afl src/* dst",
while src/* is expanded to "src/file1 src/file2, src/file3..." which
causes the "Argument list too long", use ./* as src and change cwd in
subprocess.check_output() to fix the problem.
(From OE-Core rev: a3dc93eb25fba32109edd1db6e8766074fb52e4b)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/path.py')
-rw-r--r-- | meta/lib/oe/path.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index a2a50c5b39..448a2b944e 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py | |||
@@ -103,12 +103,14 @@ def copyhardlinktree(src, dst): | |||
103 | source = '' | 103 | source = '' |
104 | if os.path.isdir(src): | 104 | if os.path.isdir(src): |
105 | if len(glob.glob('%s/.??*' % src)) > 0: | 105 | if len(glob.glob('%s/.??*' % src)) > 0: |
106 | source = '%s/.??* ' % src | 106 | source = './.??* ' |
107 | source = source + '%s/*' % src | 107 | source += './*' |
108 | s_dir = src | ||
108 | else: | 109 | else: |
109 | source = src | 110 | source = src |
110 | cmd = 'cp -afl --preserve=xattr %s %s' % (source, dst) | 111 | s_dir = os.getcwd() |
111 | subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) | 112 | cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst)) |
113 | subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT) | ||
112 | else: | 114 | else: |
113 | copytree(src, dst) | 115 | copytree(src, dst) |
114 | 116 | ||