@@ -5,14 +5,18 @@ def lfs_smudge(repository_ctx, srcs, extract = False, stripPrefix = None):
5
5
python = repository_ctx .which ("python3" ) or repository_ctx .which ("python" )
6
6
if not python :
7
7
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 ]))
8
9
res = repository_ctx .execute ([python , script ] + srcs , quiet = True )
9
10
if res .return_code != 0 :
10
11
fail ("git LFS probing failed while instantiating @%s:\n %s" % (repository_ctx .name , res .stderr ))
12
+ promises = []
11
13
for src , loc in zip (srcs , res .stdout .splitlines ()):
12
14
if loc == "local" :
13
15
if extract :
16
+ repository_ctx .report_progress ("extracting local %s" % src .basename )
14
17
repository_ctx .extract (src , stripPrefix = stripPrefix )
15
18
else :
19
+ repository_ctx .report_progress ("symlinking local %s" % src .basename )
16
20
repository_ctx .symlink (src , src .basename )
17
21
else :
18
22
sha256 , _ , url = loc .partition (" " )
@@ -22,8 +26,10 @@ def lfs_smudge(repository_ctx, srcs, extract = False, stripPrefix = None):
22
26
# it doesn't matter if file is something like some.name.zip and possible_extension == "name.zip",
23
27
# download_and_extract will just append ".name.zip" its internal temporary name, so extraction works
24
28
possible_extension = "." .join (src .basename .rsplit ("." , 2 )[- 2 :])
29
+ repository_ctx .report_progress ("downloading and extracting remote %s" % src .basename )
25
30
repository_ctx .download_and_extract (url , sha256 = sha256 , stripPrefix = stripPrefix , type = possible_extension )
26
31
else :
32
+ repository_ctx .report_progress ("downloading remote %s" % src .basename )
27
33
repository_ctx .download (url , src .basename , sha256 = sha256 )
28
34
29
35
def _download_and_extract_lfs (repository_ctx ):
0 commit comments