[bitbake-devel] [PATCH] bitbake: fetch2/git: add nobranch option for SRC_URI to skip validating SHA
Martin Jansa
martin.jansa at gmail.com
Tue Jan 7 08:34:40 UTC 2014
On Tue, Jan 07, 2014 at 11:21:06AM +0800, Zhenhua Luo wrote:
> For rebased git tree, some commits can be found in tag rather than branch, the change
> is useful for such case.
>
> Signed-off-by: Zhenhua Luo <zhenhua.luo at freescale.com>
> ---
> lib/bb/fetch2/git.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index b4b9368..6d74dbb 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -101,6 +101,8 @@ class Git(FetchMethod):
>
> ud.rebaseable = ud.parm.get("rebaseable","0") == "1"
>
> + ud.nobranch = ud.parm.get("nobranch","0") == "1"
> +
> # bareclone implies nocheckout
> ud.bareclone = ud.parm.get("bareclone","0") == "1"
> if ud.bareclone:
> @@ -217,7 +219,7 @@ class Git(FetchMethod):
> ud.repochanged = True
> os.chdir(ud.clonedir)
> for name in ud.names:
> - if not self._contains_ref(ud, d, name):
> + if not ud.nobranch and not self._contains_ref(ud, d, name):
I think that even with nobranch param set you need to check that SHA-1
is included, you just don't care in which branch if it's even included
in any.
Something like
def _contains_ref(self, tag, branch, d):
was doing before 89abfbc1953e3711d6c90aff793ee622c22609b1, so the
conditional should be in _contains_ref not skipping it completely.
> raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name]))
>
> def build_mirror_data(self, ud, d):
> --
> 1.8.4.2
>
>
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
--
Martin 'JaMa' Jansa jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20140107/5e0325f3/attachment-0002.sig>
More information about the bitbake-devel
mailing list