[bitbake-devel] [PATCH 2/4] fetch2/repo: Always check if branch is correct

Oleksandr Andrushchenko andr2000 at gmail.com
Tue Oct 24 11:35:42 UTC 2017


From: Oleksandr Andrushchenko <oleksandr_andrushchenko at epam.com>

Current implementation doesn't pay attention if
the same repository is used for manifest, but different
branch, e.g. existing cached repository is not checked
if the branch is correct. Fix this by always running
repo init/sync.

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko at epam.com>
---
 lib/bb/fetch2/repo.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/bb/fetch2/repo.py b/lib/bb/fetch2/repo.py
index c22d9b5578eb..861437dd22b2 100644
--- a/lib/bb/fetch2/repo.py
+++ b/lib/bb/fetch2/repo.py
@@ -71,9 +71,8 @@ class Repo(FetchMethod):
 
         repodir = os.path.join(codir, "repo")
         bb.utils.mkdirhier(repodir)
-        if not os.path.exists(os.path.join(repodir, ".repo")):
-            bb.fetch2.check_network_access(d, "repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), ud.url)
-            runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=repodir)
+        bb.fetch2.check_network_access(d, "repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), ud.url)
+        runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=repodir)
 
         bb.fetch2.check_network_access(d, "repo sync %s" % ud.url, ud.url)
         runfetchcmd("repo sync", d, workdir=repodir)
-- 
2.7.4




More information about the bitbake-devel mailing list