<div dir="ltr"><div><div>&gt; It is an annoying and somewhat artificial limitation. I have been known<br>
&gt; to work around it by adding a xxx.bbclass file in a classes directory<br>
&gt; and then INHERIT += &quot;xxx&quot;.<br><br></div>That&#39;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&#39;ll be adding more conditional config items so my teammates don&#39;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 = &quot;${@&#39;file:///demo/source-mirror&#39; if os.path.exists(&#39;/demo/source-mirror&#39;) else &#39;<a href="http://mycompany.com:1234/source-mirror&#39;">http://mycompany.com:1234/source-mirror&#39;</a>}&quot;
INHERIT += &quot;own-mirrors&quot;</pre><br></div>About the best thing I can say about it is: it *does* work. And it&#39;s actually pretty readable, aside from the line length being so long it won&#39;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">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</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 Fri, 2016-09-02 at 15:26 -0400, Evade Flow wrote:<br>
&gt; &gt; You could do something like:<br>
&gt; ...<br>
&gt; &gt;<br>
&gt; SOURCE_MIRROR_URL ?= &quot;{@base_contains(&#39;LOCALBUILD&#39;, &#39;local&#39;, &#39;<br>
&gt; file://xxx&#39;, &#39;<a href="http://xxx" rel="noreferrer" target="_blank">http://xxx</a>&#39;, d)}&quot;<br>
&gt;<br>
&gt;<br>
&gt; That&#39;s exactly what I was looking for, thanks. I gather I can&#39;t put<br>
&gt; functions in local.conf, which is where our current build is setting<br>
&gt; SOURCE_MIRROR_URL. Can I trouble you to recommend a home for such a<br>
&gt; function? It &#39;feels weird&#39; to put it in a recipe, is there some<br>
&gt; 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 += &quot;xxx&quot;.<br>
<br>
Cheers,<br>
<br>
Richard<br>
</blockquote></div><br></div>