<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="text-align:left; direction:ltr;">
<div>Ping!</div>
<div><br>
</div>
<div>fre 2019-08-16 klockan 08:48 &#43;0000 skrev Ernst Sjöstrand:</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre>fre 2019-05-10 klockan 12:30 &#43;0000 skrev Ernst Sjöstrand:</pre>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre>If we're trying to fetch a git, we're in try_mirror_url and</pre>
<pre>origud.localpath is a directory, that means the original clone is</pre>
<pre>broken</pre>
<pre>for some reason but we found a mirror that works.</pre>
<pre>Remove the original clone and replace it with a symlink, like what</pre>
<pre>would</pre>
<pre>hopefully be done on a fresh fetch.</pre>
<pre><br></pre>
<pre>[ Yocto # 13278 ]</pre>
<pre><br></pre>
<pre>Signed-off-by: Ernst Sjöstrand &lt;</pre>
<a href="mailto:ernst.sjostrand@verisure.com">
<pre>ernst.sjostrand@verisure.com</pre>
</a>
<pre>&gt;</pre>
<pre>---</pre>
<pre> bitbake/lib/bb/fetch2/__init__.py | 6 &#43;&#43;&#43;&#43;&#43;&#43;</pre>
<pre> 1 file changed, 6 insertions(&#43;)</pre>
<pre><br></pre>
<pre>diff --git a/bitbake/lib/bb/fetch2/__init__.py</pre>
<pre>b/bitbake/lib/bb/fetch2/__init__.py</pre>
<pre>index 72d6092deb..be1228d6d5 100644</pre>
<pre>--- a/bitbake/lib/bb/fetch2/__init__.py</pre>
<pre>&#43;&#43;&#43; b/bitbake/lib/bb/fetch2/__init__.py</pre>
<pre>@@ -33,6 &#43;33,7 @@ if 'git' not in urllib.parse.uses_netloc:</pre>
<pre>     urllib.parse.uses_netloc.append('git')</pre>
<pre> import operator</pre>
<pre> import collections</pre>
<pre>&#43;import shutil</pre>
<pre> import subprocess</pre>
<pre> import pickle</pre>
<pre> import errno</pre>
<pre>@@ -1015,6 &#43;1016,11 @@ def try_mirror_url(fetch, origud, ud, ld,</pre>
<pre>check = False):</pre>
<pre>                 if hasattr(origud.method, &quot;build_mirror_data&quot;):</pre>
<pre>                     origud.method.build_mirror_data(origud, ld)</pre>
<pre>             return origud.localpath</pre>
<pre>&#43;        if isinstance(ud.method, git.Git) and</pre>
<pre>os.path.isdir(origud.localpath) and origud.localpath != ud.localpath:</pre>
<pre>&#43;            logger.warning(&quot;Replacing %s with link to %s&quot;,</pre>
<pre>origud.localpath, ud.localpath)</pre>
<pre>&#43;            # We have an old git clone here which is broken for some</pre>
<pre>reason,</pre>
<pre>&#43;            # remove it and replace is with a symlink.</pre>
<pre>&#43;            shutil.rmtree(origud.localpath)</pre>
<pre>         # Otherwise the result is a local file:// and we symlink to</pre>
<pre>it</pre>
<pre>         if not os.path.exists(origud.localpath):</pre>
<pre>             if os.path.islink(origud.localpath):</pre>
<pre>-- </pre>
<pre>2.17.1</pre>
<pre><br></pre>
</blockquote>
<pre><br></pre>
<pre>Ping. I could write a longer explanation for why you might end up in</pre>
<pre>this situation in the commit message, though that's available in the</pre>
<pre>bug report.</pre>
<pre><br></pre>
<pre>Regards</pre>
<pre>//Ernst</pre>
<pre><br></pre>
</blockquote>
</body>
</html>