From 8553b2c11131c2c17af9a7cb3f992c204eac564a Mon Sep 17 00:00:00 2001 From: Urs Fässler Date: Mon, 8 Oct 2018 08:15:11 +0000 Subject: bitbake: fetch2/git: explicitly show the decision logic to select the source in code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Bitbake rev: 78d8fb3a7899e1404a513be1c2b2b4440da8b12d) Signed-off-by: Urs Fässler Signed-off-by: Pascal Bach Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 3e37f76ffb..51259df93f 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -476,11 +476,12 @@ class Git(FetchMethod): if os.path.exists(destdir): bb.utils.prunedir(destdir) - if ud.shallow and os.path.exists(ud.fullshallow) and self.clonedir_need_update(ud, d): + clonedir_is_up_to_date = not self.clonedir_need_update(ud, d) + if clonedir_is_up_to_date: + runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d) + elif ud.shallow and os.path.exists(ud.fullshallow): bb.utils.mkdirhier(destdir) runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) - elif not self.clonedir_need_update(ud, d): - runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d) else: raise bb.fetch2.UnpackError("No up to date source found", ud.url) -- cgit v1.2.3-54-g00ecf