@@ -5,14 +5,18 @@ def lfs_smudge(repository_ctx, srcs, extract = False, stripPrefix = None):
55 python = repository_ctx .which ("python3" ) or repository_ctx .which ("python" )
66 if not python :
77 fail ("Neither python3 nor python executables found" )
8+ repository_ctx .report_progress ("querying LFS url(s) for: %s" % ", " .join ([src .basename for src in srcs ]))
89 res = repository_ctx .execute ([python , script ] + srcs , quiet = True )
910 if res .return_code != 0 :
1011 fail ("git LFS probing failed while instantiating @%s:\n %s" % (repository_ctx .name , res .stderr ))
12+ promises = []
1113 for src , loc in zip (srcs , res .stdout .splitlines ()):
1214 if loc == "local" :
1315 if extract :
16+ repository_ctx .report_progress ("extracting local %s" % src .basename )
1417 repository_ctx .extract (src , stripPrefix = stripPrefix )
1518 else :
19+ repository_ctx .report_progress ("symlinking local %s" % src .basename )
1620 repository_ctx .symlink (src , src .basename )
1721 else :
1822 sha256 , _ , url = loc .partition (" " )
@@ -22,8 +26,10 @@ def lfs_smudge(repository_ctx, srcs, extract = False, stripPrefix = None):
2226 # it doesn't matter if file is something like some.name.zip and possible_extension == "name.zip",
2327 # download_and_extract will just append ".name.zip" its internal temporary name, so extraction works
2428 possible_extension = "." .join (src .basename .rsplit ("." , 2 )[- 2 :])
29+ repository_ctx .report_progress ("downloading and extracting remote %s" % src .basename )
2530 repository_ctx .download_and_extract (url , sha256 = sha256 , stripPrefix = stripPrefix , type = possible_extension )
2631 else :
32+ repository_ctx .report_progress ("downloading remote %s" % src .basename )
2733 repository_ctx .download (url , src .basename , sha256 = sha256 )
2834
2935def _download_and_extract_lfs (repository_ctx ):
0 commit comments