mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
bitbake: fetch/git: fix AttributeError in shallow extraction logic
This code checks to see if shallow is either disabled or the tarball is missing, but the else block tries to print the tarball filename, and this attribute doesn't exist at all when shallow is disabled. Handle the two cases separately to give sane errors for both cases without the exception: Exception: AttributeError: 'FetchData' object has no attribute 'fullshallow' (Bitbake rev: bdbb558342ebb4e64384c9838d2485d9299d91a6) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
d9175f3748
commit
e3e88600ce
|
@ -488,12 +488,15 @@ class Git(FetchMethod):
|
||||||
source_error.append("clone directory not available or not up to date: " + ud.clonedir)
|
source_error.append("clone directory not available or not up to date: " + ud.clonedir)
|
||||||
|
|
||||||
if not source_found:
|
if not source_found:
|
||||||
if ud.shallow and os.path.exists(ud.fullshallow):
|
if ud.shallow:
|
||||||
|
if os.path.exists(ud.fullshallow):
|
||||||
bb.utils.mkdirhier(destdir)
|
bb.utils.mkdirhier(destdir)
|
||||||
runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir)
|
runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir)
|
||||||
source_found = True
|
source_found = True
|
||||||
else:
|
else:
|
||||||
source_error.append("shallow clone not enabled or not available: " + ud.fullshallow)
|
source_error.append("shallow clone not available: " + ud.fullshallow)
|
||||||
|
else:
|
||||||
|
source_error.append("shallow clone not enabled")
|
||||||
|
|
||||||
if not source_found:
|
if not source_found:
|
||||||
raise bb.fetch2.UnpackError("No up to date source found: " + "; ".join(source_error), ud.url)
|
raise bb.fetch2.UnpackError("No up to date source found: " + "; ".join(source_error), ud.url)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user