Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1 V2] oe/path.py: fix for "Argument list too long"
@ 2016-12-14  7:57 Robert Yang
  2016-12-14  7:57 ` [PATCH 1/1 " Robert Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2016-12-14  7:57 UTC (permalink / raw)
  To: openembedded-core

* V2
  Fix oe/path.py:copyhardlinktree() as Ross suggested.

* V1
  package_manager.py: fix for "Argument list too long"

// Robert

The following changes since commit 4e412234c37efec42b3962c11d44903c0c58c92e:

  libpcap: Disable exposed bits of WinPCAP remote capture support (2016-12-13 22:47:35 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/long
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/long

Robert Yang (1):
  oe/path.py: fix for "Argument list too long"

 meta/lib/oe/path.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

-- 
2.10.2



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1 V2] oe/path.py: fix for "Argument list too long"
  2016-12-14  7:57 [PATCH 0/1 V2] oe/path.py: fix for "Argument list too long" Robert Yang
@ 2016-12-14  7:57 ` Robert Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Yang @ 2016-12-14  7:57 UTC (permalink / raw)
  To: openembedded-core

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@windriver.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 f73fd4a..81e7632 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -82,12 +82,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)
 
-- 
2.10.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-14  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-14  7:57 [PATCH 0/1 V2] oe/path.py: fix for "Argument list too long" Robert Yang
2016-12-14  7:57 ` [PATCH 1/1 " Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox