1
-
2
1
def _dmg_archive_impl (repository_ctx ):
3
- url = repository_ctx .attr .url
4
- (ignored , ignored , dmg_name ) = url .rpartition ("/" )
5
- dmg_name = dmg_name .replace ("%20" , "_" )
2
+ url = repository_ctx .attr .url
3
+ (ignored , ignored , dmg_name ) = url .rpartition ("/" )
4
+ dmg_name = dmg_name .replace ("%20" , "_" )
6
5
7
- attrs = {
8
- "output" : dmg_name
9
- }
10
- if repository_ctx .attr .sha256 :
11
- attrs .update ({"sha256" : repository_ctx .attr .sha256 })
6
+ attrs = {
7
+ "output" : dmg_name ,
8
+ }
9
+ if repository_ctx .attr .sha256 :
10
+ attrs .update ({"sha256" : repository_ctx .attr .sha256 })
12
11
13
- repository_ctx .download (
14
- url ,
15
- ** attrs ,
16
- )
12
+ repository_ctx .download (
13
+ url ,
14
+ ** attrs
15
+ )
17
16
18
- zip_name = dmg_name .replace (".dmg" , ".zip" )
19
- repository_ctx .execute ([
20
- repository_ctx .path (Label ("//common/private:convert_dmg.sh" )), dmg_name , zip_name ])
17
+ zip_name = dmg_name .replace (".dmg" , ".zip" )
18
+ repository_ctx .execute ([
19
+ repository_ctx .path (Label ("//common/private:convert_dmg.sh" )),
20
+ dmg_name ,
21
+ zip_name ,
22
+ ])
21
23
22
- repository_ctx .extract (
23
- archive = zip_name ,
24
- stripPrefix = repository_ctx .attr .strip_prefix ,
25
- )
24
+ repository_ctx .extract (
25
+ archive = zip_name ,
26
+ stripPrefix = repository_ctx .attr .strip_prefix ,
27
+ )
26
28
27
- repository_ctx .file (
28
- "BUILD.bazel" ,
29
- repository_ctx .attr .build_file_content ,
30
- )
29
+ repository_ctx .file (
30
+ "BUILD.bazel" ,
31
+ repository_ctx .attr .build_file_content ,
32
+ )
31
33
32
34
dmg_archive = repository_rule (
33
35
_dmg_archive_impl ,
@@ -39,5 +41,5 @@ dmg_archive = repository_rule(
39
41
"strip_prefix" : attr .string (),
40
42
"build_file_content" : attr .string (),
41
43
"build_file" : attr .label (),
42
- }
44
+ },
43
45
)
0 commit comments