bitbake: fetch2/git: explicitly show the decision logic to select the source in code

(Bitbake rev: 78d8fb3a7899e1404a513be1c2b2b4440da8b12d)

Signed-off-by: Urs Fässler <urs.fassler@bbv.ch>
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Urs Fässler
2018-10-08 08:15:11 +00:00
committed by Richard Purdie
parent 0d4fe0602e
commit 8553b2c111

View File

@@ -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)