summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorUrs Fässler <urs.fassler@bbv.ch>2018-10-08 08:15:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-18 10:59:27 +0100
commita8a077cafb0584dbb4ad4cb8a721b4d50b4180ef (patch)
tree5c11e3ff5a1c035ee1f932ec7e79469d5897785e /bitbake/lib/bb/fetch2/git.py
parent8553b2c11131c2c17af9a7cb3f992c204eac564a (diff)
downloadpoky-a8a077cafb0584dbb4ad4cb8a721b4d50b4180ef.tar.gz
bitbake: fetch2/git: provide information about missing sources
Provide more information in the case the sources are not found in the unpack step. (Bitbake rev: 27a2214bf6f2e7c61bfc422a20959a55f7e0d25d) 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>
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py29
1 files changed, 21 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 51259df93f..15858a6241 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -476,14 +476,27 @@ class Git(FetchMethod):
476 if os.path.exists(destdir): 476 if os.path.exists(destdir):
477 bb.utils.prunedir(destdir) 477 bb.utils.prunedir(destdir)
478 478
479 clonedir_is_up_to_date = not self.clonedir_need_update(ud, d) 479 source_found = False
480 if clonedir_is_up_to_date: 480 source_error = []
481 runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d) 481
482 elif ud.shallow and os.path.exists(ud.fullshallow): 482 if not source_found:
483 bb.utils.mkdirhier(destdir) 483 clonedir_is_up_to_date = not self.clonedir_need_update(ud, d)
484 runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) 484 if clonedir_is_up_to_date:
485 else: 485 runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d)
486 raise bb.fetch2.UnpackError("No up to date source found", ud.url) 486 source_found = True
487 else:
488 source_error.append("clone directory not available or not up to date: " + ud.clonedir)
489
490 if not source_found:
491 if ud.shallow and os.path.exists(ud.fullshallow):
492 bb.utils.mkdirhier(destdir)
493 runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir)
494 source_found = True
495 else:
496 source_error.append("shallow clone not enabled or not available: " + ud.fullshallow)
497
498 if not source_found:
499 raise bb.fetch2.UnpackError("No up to date source found: " + "; ".join(source_error), ud.url)
487 500
488 repourl = self._get_repo_url(ud) 501 repourl = self._get_repo_url(ud)
489 runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d, workdir=destdir) 502 runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d, workdir=destdir)