[oe-commits] [openembedded-core] 44/52: oe/path.py: fix for "Argument list too long"

git at git.openembedded.org git at git.openembedded.org
Thu Mar 16 22:23:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

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

commit 255930e7ee277f29951eced7715bc0909fff154e
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Tue Mar 14 01:45:45 2017 -0700

    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.
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oe/path.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index a2a50c5..448a2b9 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -103,12 +103,14 @@ def copyhardlinktree(src, dst):
         source = ''
         if os.path.isdir(src):
             if len(glob.glob('%s/.??*' % src)) > 0:
-                source = '%s/.??* ' % src
-            source = source + '%s/*' % src
+                source = './.??* '
+            source += './*'
+            s_dir = src
         else:
             source = src
-        cmd = 'cp -afl --preserve=xattr %s %s' % (source, dst)
-        subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+            s_dir = os.getcwd()
+        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:
         copytree(src, dst)
 

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


More information about the Openembedded-commits mailing list