<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 14, 2016 at 3:18 AM, Robert Yang <span dir="ltr">&lt;<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/14/2016 05:58 PM, Robert Yang wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On 10/13/2016 06:39 PM, Burton, Ross wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 13 October 2016 at 10:45, Robert Yang &lt;<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a><br>
&lt;mailto:<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.<wbr>com</a>&gt;&gt; wrote:<br>
<br>
    This is because &quot;copyhardlinktree(deploy_arch_<wbr>dir, arch_channel)&quot; does:<br>
    &quot;cp -afl deploy_arch_dir/* arch_channel&quot;, while the deploy_arch_dir/* is<br>
    expanded to &quot;deploy_arch_dir/pkg1 deploy_arch_dir/pkg2<br>
    deploy_arch_dir/pkg3 ...&quot; which causes the &quot;Argument list too long&quot;,<br>
    change cwd to deploy_arch_dir can avoid the error.<br>
<br>
<br>
Would it be better to change the implementation of copyhardlinktree so that it<br>
*can&#39;t* have this problem?<br>
</blockquote>
<br>
Good idea, thanks, updated in the repo:<br>
<br>
  git://<a href="http://git.openembedded.org/openembedded-core-contrib" rel="noreferrer" target="_blank">git.openembedded.org/ope<wbr>nembedded-core-contrib</a> rbt/long<br>
  <a href="http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/long" rel="noreferrer" target="_blank">http://cgit.openembedded.org/c<wbr>git.cgi/openembedded-core-cont<wbr>rib/log/?h=rbt/long</a><br>
<br>
</blockquote>
<br></span>
Sorry, this patch is not what I wanted to paste, it should be:<br>
<br>
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py<br>
index 06a5af2..1d9cca5 100644<br>
--- a/meta/lib/oe/path.py<br>
+++ b/meta/lib/oe/path.py<br>
@@ -80,15 +80,20 @@ def copyhardlinktree(src, dst):<span class=""><br>
         cmd = &quot;cd %s; find . -type d -print | tar --xattrs --xattrs-include=&#39;*&#39; -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include=&#39;*&#39; -xf - -C %s&quot; % (src, src, dst)<br>
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)<br>
         source = &#39;&#39;<br></span><span class="">
+        oldcwd = os.getcwd()<br>
         if os.path.isdir(src):<br></span>
+            dst = os.path.realpath(dst)<span class=""><br>
+            # chdir() to src to avoid &quot;Argument list too long&quot; error<br></span><span class="">
+            os.chdir(src)<br>
             import glob<br>
-            if len(glob.glob(&#39;%s/.??*&#39; % src)) &gt; 0:<br>
-                source = &#39;%s/.??* &#39; % src<br>
-            source = source + &#39;%s/*&#39; % src<br></span>
+            if len(glob.glob(&#39;./.??*&#39;)) &gt; 0:<br>
+                source = &#39;./.??* &#39;<br>
+            source += &#39;./*&#39;<span class=""><br>
         else:<br>
             source = src<br>
         cmd = &#39;cp -afl --preserve=xattr %s %s&#39; % (source, dst)<br></span>
         subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)<br>
+        os.chdir(oldcwd)</blockquote></div><br>Question, why not just pass cwd=src in the check_output() call, rather than changing it in the parent python process?<br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>