<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 20, 2013 at 8:44 AM, 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"><div class="HOEnZb"><div class="h5">On Fri, 2013-01-18 at 17:43 +0000, Kamble, Nitin A wrote:<br>
><br>
> > -----Original Message-----<br>
> > From: Saul Wold [mailto:<a href="mailto:sgw@linux.intel.com">sgw@linux.intel.com</a>]<br>
> > Sent: Friday, January 18, 2013 9:37 AM<br>
> > To: Kamble, Nitin A<br>
> > Cc: <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
> > Subject: Re: [OE-core] [PATCH 1/1] linux-yocto_3.4: use<br>
> > ${KSRC_linux_yocto_3_4_repo} based SRC_URI<br>
> ><br>
> > On 01/18/2013 09:23 AM, Kamble, Nitin A wrote:<br>
> > ><br>
> > ><br>
> > >> -----Original Message-----<br>
> > >> From: Saul Wold [mailto:<a href="mailto:sgw@linux.intel.com">sgw@linux.intel.com</a>]<br>
> > >> Sent: Friday, January 18, 2013 9:19 AM<br>
> > >> To: Kamble, Nitin A<br>
> > >> Cc: <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
> > >> Subject: Re: [OE-core] [PATCH 1/1] linux-yocto_3.4: use<br>
> > >> ${KSRC_linux_yocto_3_4_repo} based SRC_URI<br>
> > >><br>
> > >> On 01/16/2013 11:46 AM, <a href="mailto:nitin.a.kamble@intel.com">nitin.a.kamble@intel.com</a> wrote:<br>
> > >>> From: Nitin A Kamble <<a href="mailto:nitin.a.kamble@intel.com">nitin.a.kamble@intel.com</a>><br>
> > >>><br>
> > >>> This makes replacing kernel git repository easy.<br>
> > >>> For example you can add the following line in your local.conf to use<br>
> > >>> your own local kernel repository:<br>
> > >>><br>
> > >>> KSRC_linux_yocto_3_4_repo = "/home/nitin/linux-yocto-<br>
> > >> 3.4.git/;protocol=file"<br>
> > >>><br>
> > >>> Signed-off-by: Nitin A Kamble <<a href="mailto:nitin.a.kamble@intel.com">nitin.a.kamble@intel.com</a>><br>
> > >>> ---<br>
> > >>> meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a> | 3 ++-<br>
> > >>> 1 files changed, 2 insertions(+), 1 deletions(-)<br>
> > >>><br>
> > >>> diff --git a/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
> > >>> b/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
> > >>> index 70ed967..92129b6 100644<br>
> > >>> --- a/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
> > >>> +++ b/meta/recipes-kernel/linux/<a href="http://linux-yocto_3.4.bb" target="_blank">linux-yocto_3.4.bb</a><br>
> > >>> @@ -11,7 +11,8 @@ SRCREV_machine_qemux86-64 ?=<br>
> > >> "5432e2acb6053f9f7563cf63abd101ed2fdc1b6f"<br>
> > >>> SRCREV_machine ?= "5432e2acb6053f9f7563cf63abd101ed2fdc1b6f"<br>
> > >>> SRCREV_meta ?= "7e0cd2990798aae80565baa17d3b6c771874f284"<br>
> > >>><br>
> > >>> -SRC_URI = "git://<a href="http://git.yoctoproject.org/linux-yocto-" target="_blank">git.yoctoproject.org/linux-yocto-</a><br>
> > >><br>
> > 3.4.git;protocol=git;nocheckout=1;branch=${KBRANCH},${KMETA};name=ma<br>
> > >> chine,meta"<br>
> > >>> +KSRC_linux_yocto_3_4_repo ?= "<a href="http://git.yoctoproject.org/linux-yocto-" target="_blank">git.yoctoproject.org/linux-yocto-</a><br>
> > >> 3.4.git;protocol=git"<br>
> > >>> +SRC_URI =<br>
> > >><br>
> > "git://${KSRC_linux_yocto_3_4_repo};nocheckout=1;branch=${KBRANCH},${<br>
> > >> KMETA};name=machine,meta"<br>
> > >>><br>
> > >><br>
> > >> Nitin,<br>
> > >><br>
> > >> Can't the same be accomplished by setting SRC_URI-yocto-linux in your<br>
> > >> local.conf file:<br>
> > >><br>
> > >>> SRC_URI_linux-yocto =<br>
> > >>> "/home/nitin/linux-yocto-3.4.git/;protocol=file<br>
> > >> ;nocheckout=1;branch=${KBRANCH},${KMETA};name=machine,meta"<br>
> > >><br>
> > >> Yes, it might require a little cut paste of the nocheck... part.<br>
> > >><br>
> > >> Sau!<br>
> > >><br>
> > ><br>
> > ><br>
> > > Saul,<br>
> > > This way same settings can be used for any BSP. And shouldn't we make<br>
> > life of YP developer easy?<br>
> > ><br>
> > This just seems like an extra variable that then needs to be documented<br>
> > when the SRC_URI already exists for this purpose.<br>
><br>
> And this new variable is going to make kernel developer's life easy to just replace the kernel repository<br>
> while keeping all the kernel repo branch names same.<br>
><br>
> As a kernel/BSP developer it definitely makes my life easier.<br>
<br>
</div></div>I'm not taking things like this which solve a given specialist use case<br>
but would need to result in every recipe changing where someone wanted<br>
to do this. To be blunt, your choice of variable name also sucks.<br>
<br>
Embrace the power of the scripting we have, there are much more<br>
interesting ways to solve this problem generically. For example, I wrote<br>
this piece of code in a few minutes (admittedly untested):<br>
<br></blockquote><div><br></div><div style>Agreed! I'm not even sure how I missed that this was to the *oe-core* linux-yocto</div><div style>recipes (Nitin: you need to cc' me, or let me stage and merge changes to these</div>
<div style>recipes as a general rule), but I wouldn't have let this in either. </div><div style><br></div><div style>I admit to having such things in local/hack layers, but they definitely are not something</div><div style>
I'd ever have wanted to see in main recipes.</div><div style><br></div><div style>Cheers,</div><div style><br></div><div style>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
urlremapper.bbclass:<br>
<br>
python () {<br>
mod = False<br>
newsrcuri = []<br>
srcuri = (d.getVar("SRC_URI", True) or "").split()<br>
maps = d.getVarFlags("URLREMAP")<br>
for uri in srcuri:<br>
for u in maps:<br>
if uri.startswith(u):<br>
uri.replace(u, maps[u])<br>
mod = True<br>
newsrcuri.append(uri)<br>
if mod:<br>
d.setVar("SRC_URI", " ".join(newsrcuri))<br>
}<br>
<br>
<br>
URLREMAP[git://<a href="http://git.yoctoproject.org/linux-yocto-3.4.git" target="_blank">git.yoctoproject.org/linux-yocto-3.4.git</a>] = "git:///home/nitin/linux-yocto-3.4.git/;protocol=file"<br>
<br>
which should do what you want but in a generic way which doesn't require<br>
us to hack each recipe. You can do it completely locally if you create a<br>
classes directory alongside your conf directory and place the .bbclass<br>
there, then add INHERIT += "urlremapper" in local.conf.<br>
<br>
Cheers,<br>
<br>
Richard<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"
</div></div>