[poky] On Bug 972 - tag does not work in git fetcher

Yu, Ke ke.yu at intel.com
Wed Apr 20 00:51:16 PDT 2011


Hi Richard,

I get the root cause of bug 972 (http://bugzilla.pokylinux.org/show_bug.cgi?id=972) , and want to get your comments on how to fix the bug.

the culprit of this bug is commit http://git.pokylinux.org/cgit/cgit.cgi/poky/commit/?id=5920e85c561624e657c126df58f5c378a8950bbc :
"
bitbake/fetch2/git: Ensure unresolved branches are translated into revisions

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 6bcc4a4..f05a360 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -72,7 +72,8 @@ class Git(FetchMethod):
         ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
 
         for name in ud.names:
-            if not ud.revisions[name] or ud.revisions[name] == "master":
+            # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
+            if not ud.revisions[name] or len(ud.revisions[name]) != 40  or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
                 ud.revisions[name] = self.latest_revision(url, ud, d, name)
 
         ud.localfile = ud.clonedir
"
with this commit, tag is treated as invalid revision since it is not sha256 checksum, so tag become unusable. 

To fix it,  one option is to revert this commit, another option is to check if ud.revisions[name] is tag. I prefer the first option to revert this commit, because if user set incorrect revision, reporting error to user would be better.  In this case user have chance to fix it. the above commit actually hide the error from user which sound not good.

On the other hand, I don't remember the purpose of this commit, so want to get your comment to make sure not breaking other things.

Regards
Ke



More information about the poky mailing list