diff mbox series

[3/3] fetch2/git: Add offline build support for LFS

Message ID 20250129112406.1660522-4-stefan-koch@siemens.com
State New
Headers show
Series fetch2/git: Improve shallow, lfs, and tag support | expand

Commit Message

Stefan Koch Jan. 29, 2025, 11:24 a.m. UTC
This adds support for offline builds for repos that use git-lfs.
Offline building is enabled when `BB_NO_NETWORK = "1"` is set.

Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
---
 lib/bb/fetch2/git.py | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexander Kanavin Jan. 29, 2025, 12:42 p.m. UTC | #1
This needs a slightly better explanation. What kind of breakage is
happening currently, and how does the change address it?

Alex

On Wed, 29 Jan 2025 at 12:24, Koch, Stefan via lists.openembedded.org
<stefan-koch=siemens.com@lists.openembedded.org> wrote:
>
> This adds support for offline builds for repos that use git-lfs.
> Offline building is enabled when `BB_NO_NETWORK = "1"` is set.
>
> Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
> ---
>  lib/bb/fetch2/git.py | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index 7ac690bbe..b7d36c3f3 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -507,6 +507,7 @@ class Git(FetchMethod):
>              # Create an initial regular clone
>              if not shallowstate:
>                  runfetchcmd(clone_cmd, d, log=progresshandler)
> +                self.lfs_fetch(ud, d, ud.clonedir, ud.revisions[ud.names[0]], progresshandler, True)
>
>          # Update the checkout if needed
>          if self.clonedir_need_update(ud, d):
> --
> 2.39.5
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#17111): https://lists.openembedded.org/g/bitbake-devel/message/17111
> Mute This Topic: https://lists.openembedded.org/mt/110876223/1686489
> Group Owner: bitbake-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 7ac690bbe..b7d36c3f3 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -507,6 +507,7 @@  class Git(FetchMethod):
             # Create an initial regular clone
             if not shallowstate:
                 runfetchcmd(clone_cmd, d, log=progresshandler)
+                self.lfs_fetch(ud, d, ud.clonedir, ud.revisions[ud.names[0]], progresshandler, True)
 
         # Update the checkout if needed
         if self.clonedir_need_update(ud, d):