[bitbake-devel] [PATCH] bitbake: fetch2/git: Allow HEAD to be searched.

Richard Purdie richard.purdie at linuxfoundation.org
Tue Apr 28 16:47:54 UTC 2015


On Mon, 2015-04-27 at 11:16 -0500, Mariano Lopez wrote:
> This makes it possble to fetch/search HEAD. This is useful when 
> searching for HEAD doing the sanity check.
> 
> Please disregard previous patch with the same topic.
> 
> [YOCTO #7592]
> 
> Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
> ---
>   bitbake/lib/bb/fetch2/git.py | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
> index 0d91431..12fb6a2 100644
> --- a/bitbake/lib/bb/fetch2/git.py
> +++ b/bitbake/lib/bb/fetch2/git.py
> @@ -345,6 +345,9 @@ class Git(FetchMethod):
>           if ud.unresolvedrev[name][:5] == "refs/":
>               head = ud.unresolvedrev[name]
>               tag = ud.unresolvedrev[name]
> +        elif ud.unresolvedrev[name] == "HEAD":
> +            head = ud.unresolvedrev[name]
> +            tag = ud.unresolvedrev[name]
>           else:
>               head = "refs/heads/%s" % ud.unresolvedrev[name]
>               tag = "refs/tags/%s" % ud.unresolvedrev[name]

Looking at the bug, I think the example in poky.conf needs fixing not to
use HEAD rather than this patch.

I'd also mention that you could do:

if ud.unresolvedrev[name][:5] == "refs/" or  ud.unresolvedrev[name] == "HEAD":

rather than duplicate code. The whitespace in this patch is also broken.

Cheers,

Richard




More information about the bitbake-devel mailing list