<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"><<a href="mailto:pascal.bach@siemens.com" target="_blank">pascal.bach@siemens.com</a>></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>
><br>
> On Fri, Sep 16, 2016 at 1:58 AM, Pascal Bach <<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.com</a> <mailto:<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.<wbr>com</a>>> wrote:<br>
><br>
> When an update of the local copy is required always try to fetch the update<br>
> from a premirror first.<br>
> The premirror should always have precedence over the upstream repository<br>
> as updating from there might not work if BB_FETCH_PREMIRRORONLY,<br>
> BB_NO_NBB_ALLOWED_NETWORKS or BB_NO_NETWORK is set.<br>
><br>
> This also gets rid of the special case for BB_FETCH_PREMIRRORONLY.<br>
><br>
</span>> Signed-off-by: Pascal Bach <<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.com</a> <mailto:<a href="mailto:pascal.bach@siemens.com">pascal.bach@siemens.<wbr>com</a>>><br>
<span class="">> ---<br>
> lib/bb/fetch2/git.py | 9 ++-------<br>
> 1 file changed, 2 insertions(+), 7 deletions(-)<br>
><br>
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py<br>
> index 1bec60a..cac2a87 100644<br>
> --- a/lib/bb/fetch2/git.py<br>
> +++ b/lib/bb/fetch2/git.py<br>
> @@ -227,13 +227,8 @@ class Git(FetchMethod):<br>
> return False<br>
><br>
> def try_premirror(self, ud, d):<br>
> - # If we don't do this, updating an existing checkout with only premirrors<br>
> - # is not possible<br>
> - if d.getVar("BB_FETCH_<wbr>PREMIRRORONLY", True) is not None:<br>
> - return True<br>
> - if os.path.exists(ud.clonedir):<br>
> - return False<br>
> - return True<br>
> + # Always try premirror if an update is required<br>
> + return self.need_update(ud, d)<br>
><br>
><br>
> 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'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>