diff options
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index e171aa7eb1..5fd63b4e33 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -464,6 +464,8 @@ class Git(FetchMethod): | |||
464 | if os.path.exists(destdir): | 464 | if os.path.exists(destdir): |
465 | bb.utils.prunedir(destdir) | 465 | bb.utils.prunedir(destdir) |
466 | 466 | ||
467 | need_lfs = ud.parm.get("lfs", "1") == "1" | ||
468 | |||
467 | source_found = False | 469 | source_found = False |
468 | source_error = [] | 470 | source_error = [] |
469 | 471 | ||
@@ -493,14 +495,16 @@ class Git(FetchMethod): | |||
493 | runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d, workdir=destdir) | 495 | runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d, workdir=destdir) |
494 | 496 | ||
495 | if self._contains_lfs(ud, d, destdir): | 497 | if self._contains_lfs(ud, d, destdir): |
496 | path = d.getVar('PATH') | 498 | if need_lfs: |
497 | if path: | 499 | path = d.getVar('PATH') |
498 | gitlfstool = bb.utils.which(path, "git-lfs", executable=True) | 500 | if path: |
499 | if not gitlfstool: | 501 | gitlfstool = bb.utils.which(path, "git-lfs", executable=True) |
500 | raise bb.fetch2.FetchError("Repository %s has lfs content, install git-lfs plugin on host to download" % (repourl)) | 502 | if not gitlfstool: |
503 | raise bb.fetch2.FetchError("Repository %s has LFS content, install git-lfs on host to download (or set lfs=0 to ignore it)" % (repourl)) | ||
504 | else: | ||
505 | bb.note("Could not find 'PATH'") | ||
501 | else: | 506 | else: |
502 | bb.note("Could not find 'PATH'") | 507 | bb.note("Repository %s has LFS content but it is not being fetched" % (repourl)) |
503 | |||
504 | 508 | ||
505 | if not ud.nocheckout: | 509 | if not ud.nocheckout: |
506 | if subdir != "": | 510 | if subdir != "": |