aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorUrs Fässler <urs.fassler@bbv.ch>2018-10-08 08:15:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-17 12:24:05 +0100
commit30cf2506007d25162f0805051212f54c39034ff3 (patch)
tree663945a26a775611f4f21ab8d642c258356cb711 /lib/bb/fetch2/git.py
parent5e69ca56533666a097bb23d09ab673e5c862051c (diff)
downloadbitbake-30cf2506007d25162f0805051212f54c39034ff3.tar.gz
fetch2/git: prevent access to non-existing clonedir
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. 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 'lib/bb/fetch2/git.py')
-rw-r--r--lib/bb/fetch2/git.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index f13a25f99..3e37f76ff 100644
--- a/lib/bb/fetch2/git.py
+++ b/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)