diff options
author | Christopher Larson <chris_larson@mentor.com> | 2018-11-21 23:14:07 +0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-26 20:16:24 +0000 |
commit | 93fc92cf42b07ad9896ace7969e79e2bb25b46ea (patch) | |
tree | 6b7659896f5ab702b5d219b8de52dd0c9478c7aa /bitbake/lib | |
parent | 94b13882510561b4ab7c08fd0343038c154680a4 (diff) | |
download | poky-93fc92cf42b07ad9896ace7969e79e2bb25b46ea.tar.gz |
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: b0ad961064ef6ecd77fab3435e5652c4ae284426)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 15858a6241..59a2ee8f80 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -488,12 +488,15 @@ class Git(FetchMethod): | |||
488 | source_error.append("clone directory not available or not up to date: " + ud.clonedir) | 488 | source_error.append("clone directory not available or not up to date: " + ud.clonedir) |
489 | 489 | ||
490 | if not source_found: | 490 | if not source_found: |
491 | if ud.shallow and os.path.exists(ud.fullshallow): | 491 | if ud.shallow: |
492 | bb.utils.mkdirhier(destdir) | 492 | if os.path.exists(ud.fullshallow): |
493 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) | 493 | bb.utils.mkdirhier(destdir) |
494 | source_found = True | 494 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) |
495 | source_found = True | ||
496 | else: | ||
497 | source_error.append("shallow clone not available: " + ud.fullshallow) | ||
495 | else: | 498 | else: |
496 | source_error.append("shallow clone not enabled or not available: " + ud.fullshallow) | 499 | source_error.append("shallow clone not enabled") |
497 | 500 | ||
498 | if not source_found: | 501 | if not source_found: |
499 | raise bb.fetch2.UnpackError("No up to date source found: " + "; ".join(source_error), ud.url) | 502 | raise bb.fetch2.UnpackError("No up to date source found: " + "; ".join(source_error), ud.url) |