All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: andr2000@gmail.com,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: [PATCH 2/4] fetch2/repo: Always check if branch is correct
Date: Tue, 24 Oct 2017 14:35:42 +0300	[thread overview]
Message-ID: <1508844944-5761-3-git-send-email-andr2000@gmail.com> (raw)
In-Reply-To: <1508844944-5761-1-git-send-email-andr2000@gmail.com>

From: Oleksandr Andrushchenko <oleksandr_andrushchenko@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@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



  parent reply	other threads:[~2017-10-24 11:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 11:35 [PATCH 0/4] fetch2/repo: Repo fetcher fixes and improvements Oleksandr Andrushchenko
2017-10-24 11:35 ` [PATCH 1/4] fetch2/repo: Fix missing logger import in repo fetcher Oleksandr Andrushchenko
2017-10-24 11:35 ` Oleksandr Andrushchenko [this message]
2017-10-24 11:35 ` [PATCH 3/4] fetch2/repo: Make fetcher always sync on unpack Oleksandr Andrushchenko
2017-11-07 13:45   ` Richard Purdie
2017-11-07 19:31     ` Oleksandr Andrushchenko
2017-11-08 18:09       ` Richard Purdie
2017-10-24 11:35 ` [PATCH 4/4] fetch2/repo: Use multiple jobs to fetch and sync Oleksandr Andrushchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1508844944-5761-3-git-send-email-andr2000@gmail.com \
    --to=andr2000@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=oleksandr_andrushchenko@epam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.