Bug 3443

Summary: git fetcher: support a more appendable syntax for supporting multiple branches in the SRC_URI
Product: [Build System, Metadata & Runtime] BitBake Reporter: Tom Zanussi <tom.zanussi>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: Low CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Tom Zanussi 2012-11-15 16:07:45 UTC
The linux-yocto kernel makes use of multiple git branches in the SRC_URI.  Normally there are only two, the 'meta' branch and the 'machine' branch, which are the branches specified in the main kernel recipes e.g.:

meta/recipes-kernel/linux/linux-yocto_3.4.bb:

SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.4.git;protocol=git;nocheckout=1;branch=${KBRANCH},meta;name=machine,meta"

The comment for the code to handle this explains how it works:

- branch
   The git branch to retrieve from. The default is "master"

   this option also support multiple branches fetching, branches
   are seperated by comma. in multiple branches case, the name option
   must have the same number of names to match the branches, which is
   used to specify the SRC_REV for the branch
   e.g:
   SRC_URI="git://some.host/somepath;branch=branchX,branchY;name=nameX,nameY"

For some of the BSPs, we need to add additional branches to the SRC_URI, but because the -branch SRC_URI option requires the additional information for the new branch be split between the branch and name options, we can't simply append the new branch information but need to override the SRC_URI to add it.

e.g. in our .bbappend we need to do the following to add a new 'emgd' branch:

SRC_URI_crownbay = "git://git.yoctoproject.org/linux-yocto-3.4.git;protocol=git;nocheckout=1;branch=${KBRANCH},meta,emgd-1.14;name=machine,meta,emgd"

We should be able simply append the information, something like this would allow us to avoid overriding the whole SRC_URI:

SRC_URI_crownbay += "branch:emgd-1.14,emgd"
Comment 1 Randy MacLeod 2021-06-10 15:10:55 UTC
This a small problem, there are other ways to deal with this such as appending to KBRANCH. so closing.