From 0d4fe0602ef4ac80f3cea471e48b96b71a585669 Mon Sep 17 00:00:00 2001 From: Urs Fässler Date: Mon, 8 Oct 2018 08:15:10 +0000 Subject: bitbake: fetch2/git: prevent access to non-existing clonedir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A user friendly error is throw when neither the clonedir nor fullshallow exist. Without the check, a difficult to interpret error is throw from within the fetch command. (Bitbake rev: 30cf2506007d25162f0805051212f54c39034ff3) Signed-off-by: Urs Fässler Signed-off-by: Pascal Bach Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/fetch2') diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index f13a25f99d..3e37f76ffb 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -479,8 +479,10 @@ class Git(FetchMethod): if ud.shallow and os.path.exists(ud.fullshallow) and self.clonedir_need_update(ud, d): bb.utils.mkdirhier(destdir) runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) - else: + 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) repourl = self._get_repo_url(ud) runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d, workdir=destdir) -- cgit v1.2.3-54-g00ecf