diff options
| author | Urs Fässler <urs.fassler@bbv.ch> | 2018-10-08 08:15:11 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-18 10:59:26 +0100 |
| commit | 8553b2c11131c2c17af9a7cb3f992c204eac564a (patch) | |
| tree | 450a67f262a474d2c4764c559555e94f3fb1950b /bitbake | |
| parent | 0d4fe0602ef4ac80f3cea471e48b96b71a585669 (diff) | |
| download | poky-8553b2c11131c2c17af9a7cb3f992c204eac564a.tar.gz | |
bitbake: fetch2/git: explicitly show the decision logic to select the source in code
(Bitbake rev: 78d8fb3a7899e1404a513be1c2b2b4440da8b12d)
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 'bitbake')
| -rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 3e37f76ffb..51259df93f 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
| @@ -476,11 +476,12 @@ class Git(FetchMethod): | |||
| 476 | if os.path.exists(destdir): | 476 | if os.path.exists(destdir): |
| 477 | bb.utils.prunedir(destdir) | 477 | bb.utils.prunedir(destdir) |
| 478 | 478 | ||
| 479 | if ud.shallow and os.path.exists(ud.fullshallow) and self.clonedir_need_update(ud, d): | 479 | clonedir_is_up_to_date = not self.clonedir_need_update(ud, d) |
| 480 | if clonedir_is_up_to_date: | ||
| 481 | runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d) | ||
| 482 | elif ud.shallow and os.path.exists(ud.fullshallow): | ||
| 480 | bb.utils.mkdirhier(destdir) | 483 | bb.utils.mkdirhier(destdir) |
| 481 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) | 484 | runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir) |
| 482 | elif not self.clonedir_need_update(ud, d): | ||
| 483 | runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d) | ||
| 484 | else: | 485 | else: |
| 485 | raise bb.fetch2.UnpackError("No up to date source found", ud.url) | 486 | raise bb.fetch2.UnpackError("No up to date source found", ud.url) |
| 486 | 487 | ||
