<div dir="ltr"><div><div>> It is an annoying and somewhat artificial limitation. I have been known<br>
> to work around it by adding a xxx.bbclass file in a classes directory<br>
> and then INHERIT += "xxx".<br><br></div>That's a really handy trick to know about, thanks! I will probably switch to that approach soon since—now that I see the possibilities—I anticipate I'll be adding more conditional config items so my teammates don't have to worry about it.<br><br>The solution I managed to finger-mumble my way to in the meantime is a little scary-looking:<br><br><pre>SOURCE_MIRROR_URL = "${@'file:///demo/source-mirror' if os.path.exists('/demo/source-mirror') else '<a href="http://mycompany.com:1234/source-mirror'">http://mycompany.com:1234/source-mirror'</a>}"
INHERIT += "own-mirrors"</pre><br></div>About the best thing I can say about it is: it *does* work. And it's actually pretty readable, aside from the line length being so long it won't fit in a tweet(!)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 2, 2016 at 5:46 PM, Richard Purdie <span dir="ltr"><<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, 2016-09-02 at 15:26 -0400, Evade Flow wrote:<br>
> > You could do something like:<br>
> ...<br>
> ><br>
> SOURCE_MIRROR_URL ?= "{@base_contains('LOCALBUILD', 'local', '<br>
> file://xxx', '<a href="http://xxx" rel="noreferrer" target="_blank">http://xxx</a>', d)}"<br>
><br>
><br>
> That's exactly what I was looking for, thanks. I gather I can't put<br>
> functions in local.conf, which is where our current build is setting<br>
> SOURCE_MIRROR_URL. Can I trouble you to recommend a home for such a<br>
> function? It 'feels weird' to put it in a recipe, is there some<br>
> other, semi-standard place to stuff helper functions?<br>
<br>
</span>It is an annoying and somewhat artificial limitation. I have been known<br>
to work around it by adding a xxx.bbclass file in a classes directory<br>
and then INHERIT += "xxx".<br>
<br>
Cheers,<br>
<br>
Richard<br>
</blockquote></div><br></div>