1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

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)

(From OE-Core rev: befda6ce3fd916ab04c035d1d82ed173759f7f09)

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>
This commit is contained in:
Robert Yang
2017-03-14 01:45:45 -07:00
committed by Richard Purdie
parent a992a31803
commit d4b41223d3
+6 -4
View File
@@ -83,12 +83,14 @@ def copyhardlinktree(src, dst):
if os.path.isdir(src): if os.path.isdir(src):
import glob import glob
if len(glob.glob('%s/.??*' % src)) > 0: if len(glob.glob('%s/.??*' % src)) > 0:
source = '%s/.??* ' % src source = './.??* '
source = source + '%s/*' % src source += './*'
s_dir = src
else: else:
source = src source = src
cmd = 'cp -afl --preserve=xattr %s %s' % (source, dst) s_dir = os.getcwd()
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst))
subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT)
else: else:
copytree(src, dst) copytree(src, dst)