[oe-commits] [bitbake] 02/04: fetch2/git: explicitly show the decision logic to select the source in code

git at git.openembedded.org git at git.openembedded.org
Tue Oct 16 20:21:04 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 99325fc5681ea8e1993199f898a4f7ce7dd34bf4
Author: Urs Fässler <urs.fassler at bbv.ch>
AuthorDate: Mon Oct 8 08:15:11 2018 +0000

    fetch2/git: explicitly show the decision logic to select the source in code
    
    Signed-off-by: Urs Fässler <urs.fassler at bbv.ch>
    Signed-off-by: Pascal Bach <pascal.bach at siemens.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/git.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 3e37f76..51259df 100644
--- a/lib/bb/fetch2/git.py
+++ b/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)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list