<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 19, 2016 at 12:22 AM, Pascal Bach <span dir="ltr">&lt;<a href="mailto:pascal.bach@siemens.com" target="_blank">pascal.bach@siemens.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1mi" class="a3s aXjCH m157415341d53978d">On 16.09.2016 18:20, Christopher Larson wrote:<br>
<span class=""><br>
&gt;<br>
&gt; On Fri, Sep 16, 2016 at 1:58 AM, Pascal Bach &lt;<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.com</a> &lt;mailto:<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.<wbr>com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     When an update of the local copy is required always try to fetch the update<br>
&gt;     from a premirror first.<br>
&gt;     The premirror should always have precedence over the upstream repository<br>
&gt;     as updating from there might not work if BB_FETCH_PREMIRRORONLY,<br>
&gt;     BB_NO_NBB_ALLOWED_NETWORKS or BB_NO_NETWORK is set.<br>
&gt;<br>
&gt;     This also gets rid of the special case for BB_FETCH_PREMIRRORONLY.<br>
&gt;<br>
</span>&gt;     Signed-off-by: Pascal Bach &lt;<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.com</a> &lt;mailto:<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.<wbr>com</a>&gt;&gt;<br>
<span class="">&gt;     ---<br>
&gt;      lib/bb/fetch2/git.py | 9 ++-------<br>
&gt;      1 file changed, 2 insertions(+), 7 deletions(-)<br>
&gt;<br>
&gt;     diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py<br>
&gt;     index 1bec60a..cac2a87 100644<br>
&gt;     --- a/lib/bb/fetch2/git.py<br>
&gt;     +++ b/lib/bb/fetch2/git.py<br>
&gt;     @@ -227,13 +227,8 @@ class Git(FetchMethod):<br>
&gt;              return False<br>
&gt;<br>
&gt;          def try_premirror(self, ud, d):<br>
&gt;     -        # If we don&#39;t do this, updating an existing checkout with only premirrors<br>
&gt;     -        # is not possible<br>
&gt;     -        if d.getVar(&quot;BB_FETCH_<wbr>PREMIRRORONLY&quot;, True) is not None:<br>
&gt;     -            return True<br>
&gt;     -        if os.path.exists(ud.clonedir):<br>
&gt;     -            return False<br>
&gt;     -        return True<br>
&gt;     +        # Always try premirror if an update is required<br>
&gt;     +        return self.need_update(ud, d)<br>
&gt;<br>
&gt;<br>
&gt; Will this result in fetching a mirror tarball even if you already have a clone in ud.clonedir? The previous logic always returned False if the clonedir existed..<br>
</span>The tarball should only be fetched if the local ud.clonedir is out of date, this means the revision that is requested via SRCREV is not in the local repository.<br>
In the case the revision is present the tarball should not be fetched again, at least that was the intention and my local tests didn&#39;t indicate otherwise.<br></div></blockquote><div><br></div><div>Yes, but it’s better to run ‘git fetch’ in an out of date clone than to re-download a 1gb mirror tarball which may well be out of date too.</div></div>-- <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>