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

Christopher Larson kergoth at gmail.com
Fri Aug 14 16:54:17 UTC 2015


On Thu, Aug 13, 2015 at 4:46 PM, Christopher Larson <kergoth at gmail.com>
wrote:

> This only implements support for shallow mirror tarballs, not shallow
> clones.
>
> The 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.
>
> The shallow support will not, at this time, function correctly for
> linux-yocto, due to its branching scheme & validation.
>
> 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"
>
> This implementation will attempt to fetch a full mirror tarball if it was
> unable to fetch a shallow tarball. If `BB_GIT_SHALLOW` and
> `BB_GENERATE_MIRROR_TARBALLS` are enabled for a given recipe, a shallow
> tarball will be emitted.
>

The other thing I forgot to mention is that the shallow tarballs aren't
unpacked into ${DL_DIR}/git2/ the way the full ones are, they're unpacked
directly into the destination under ${WORKDIR}, to avoid complexities and
confusion. This is why localpath() now returns the shallow tarball path
when it exists, to avoid issues with checksums, and because we don't
need/want download() to do anything else after it's fetched.

I just realized there's a slight inconsistency in the current behavior.
When shallow and the shallow tarball exists, localpath() returns that path,
but in the case where both ud.clonedir and the shallow tarball exists, the
former will be unpacked, not the latter. I'll have to double check that the
case where we have an existing out of date clonedir doesn't cause a shallow
tarball to be fetched, otherwise it'll bypass updating the clonedir in
download() and then unpack the out of date clonedir into workdir. If that's
an issue, can make unpack() prefer the shallow tarball when shallow and the
tarball exists, even if clonedir exists.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20150814/9efb0d0d/attachment-0002.html>


More information about the bitbake-devel mailing list