* [PATCH 0/1] Fixes for the Git fetcher
@ 2016-05-23 11:35 Peter Kjellerstedt
2016-05-23 11:35 ` [PATCH 1/1] fetch2/git.py: References must match exactly Peter Kjellerstedt
0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2016-05-23 11:35 UTC (permalink / raw)
To: bitbake-devel
This fixes a problem with the Git fetcher where it could assign the
wrong SHA-1 to a Git reference. The problem was that the matching done
in _latest_revision() wasn't exact, which means that, e.g., SRCREV =
"R${PV}" where PV = "1.0" would match a tag called R1.0.0, rather than
fail as it should since the tag R1.0 does not exist.
//Peter
The following changes since commit c7e614c438706fb3ed7520b4990ebb3973366942:
useradd: Fix infinite build loop (2016-05-23 10:33:45 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib pkj/exact_git_refs
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/exact_git_refs
Peter Kjellerstedt (1):
fetch2/git.py: References must match exactly
bitbake/lib/bb/fetch2/git.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH 1/1] fetch2/git.py: References must match exactly
2016-05-23 11:35 [PATCH 0/1] Fixes for the Git fetcher Peter Kjellerstedt
@ 2016-05-23 11:35 ` Peter Kjellerstedt
0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2016-05-23 11:35 UTC (permalink / raw)
To: bitbake-devel
Previously the code used to match a reference to its SHA-1 in
_latest_revision() used the Python "in" operator, which made it match
if the reference matched the beginning of an existing tag or
branch. This test, however, must be exact. I.e., either the reference
matches a tag or branch exactly, or it does not match at all.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
bitbake/lib/bb/fetch2/git.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 526668b..59827e3 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -350,9 +350,10 @@ class Git(FetchMethod):
head = "refs/heads/%s" % ud.unresolvedrev[name]
tag = "refs/tags/%s" % ud.unresolvedrev[name]
for s in [head, tag + "^{}", tag]:
- for l in output.split('\n'):
- if s in l:
- return l.split()[0]
+ for l in output.strip().split('\n'):
+ sha1, ref = l.split()
+ if s == ref:
+ return sha1
raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \
(ud.unresolvedrev[name], ud.host+ud.path))
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-23 11:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-23 11:35 [PATCH 0/1] Fixes for the Git fetcher Peter Kjellerstedt
2016-05-23 11:35 ` [PATCH 1/1] fetch2/git.py: References must match exactly Peter Kjellerstedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.