[bitbake-devel] [PATCH 0/4] Implement git shallow mirror tarball support

Christopher Larson kergoth at gmail.com
Wed Aug 26 16:38:04 UTC 2015


From: Christopher Larson <chris_larson at mentor.com>

Supercedes `[RFC PATCH 0/5] Implement git shallow mirror tarball support`.

The shallow mirror tarball filename includes branch, revision, and depth. To
enable, use the BB_GIT_SHALLOW variable, or BB_GIT_SHALLOW_<name> for specific
URLs. This variable can hold either a clone depth (e.g. 1 to just get SRCREV),
or a ref or commit, in which case we keep history up to that commit.

Example:

    BB_GIT_SHALLOW ?= "1"
    BB_GIT_SHALLOW_pn-linux-yocto = ""
    BB_GIT_SHALLOW_pn-linux-mel_mx6 = "v3.14"
    BB_GIT_SHALLOW_pn-testrepo = "testbranch"

Example in a recipe with multiple named uris, or multiple named branches in a
single git URI:

    BB_GIT_SHALLOW_main = "1"
    BB_GIT_SHALLOW_doc = ""

BB_GIT_SHALLOW affects both the tarballs being fetched and the mirror tarball
which is created when BB_GENERATE_MIRROR_TARBALLS is enabled. If the shallow
mirror tarball cannot be fetched, it will try to fetch the full mirror tarball
and use that.

Limitations:

The shallow support will not, at this time, function correctly for
linux-yocto, due to its branching scheme & validation.

This implements support for shallow mirror tarballs, not shallow clones.
Supporting shallow clones directly would be rather more problematic, as we'd
need to hardcode the depth between branch HEAD and the SRCREV, and that depth
would change as the branch is updated.

Christopher Larson (4):
  bb.fetch: simplify mirror tarball handling in try_mirror_url
  bb.fetch: support ud.mirrortarballs
  bb.fetch.git: add support for shallow mirror tarballs
  bb.fetch.git: truncate branches to SRCREV

 lib/bb/fetch2/__init__.py |  27 +++----
 lib/bb/fetch2/git.py      | 177 +++++++++++++++++++++++++++++++++++-----------
 2 files changed, 152 insertions(+), 52 deletions(-)

-- 
2.2.1




More information about the bitbake-devel mailing list