fetch2/git.py: update way to check contains lfs
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines · Changqing Li
From: Changqing Li <[email protected]>
Fix below
do_unpackfailure since "_contains_lfs" check result is wrong:
Fetcher failure: Repository ... has LFS content, install git-lfs on host to download (or set lfs=0 to ignore it)Take recipe freeradius as example:
current freeradius is version 3.0.20, and branch is v3.0.x. and it don't contains lfs. but since we checked HEAD, which is point to master by default,_contains_lfswill think it contains lfs since the master contains lfs, and meantime, we don't have git-lfs on host, so unpack will failed.Fixed by check on the configured branch.
Signed-off-by Changqing Li <[email protected]>--- bitbake/lib/bb/fetch2/git.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)bitbake/lib/bb/fetch2/git.py +0
-0
bitbake/lib/bb/fetch2/git.py class Git(FetchMethod): · line 570
Quoted 10 lines
bitbake/lib/bb/fetch2/git.py +2
-2@@ -563,8 +563,8 @@ class Git(FetchMethod): """ Check if the repository has 'lfs' (large file) content """ - cmd = "%s grep lfs HEAD:.gitattributes | wc -l" % ( - ud.basecmd) + cmd = "%s grep lfs origin/%s:.gitattributes | wc -l" % ( + ud.basecmd, ud.branches[ud.names[0]]) try: output = runfetchcmd(cmd, d, quiet=True, workdir=wd) if int(output) > 0:
This can fix mismatch caused by branch, but I think maybe there still
maybe mismatch caused by different version, like version 3.0.20 / 3.0.21.
what is your opinion about this?