|
34 | 34 | ":utils.bzl", |
35 | 35 | "patch", |
36 | 36 | "read_netrc", |
| 37 | + "read_user_netrc", |
37 | 38 | "update_attrs", |
38 | 39 | "use_netrc", |
39 | 40 | "workspace_and_buildfile", |
@@ -77,21 +78,9 @@ def _get_auth(ctx, urls): |
77 | 78 | """Given the list of URLs obtain the correct auth dict.""" |
78 | 79 | if ctx.attr.netrc: |
79 | 80 | netrc = read_netrc(ctx, ctx.attr.netrc) |
80 | | - return use_netrc(netrc, urls, ctx.attr.auth_patterns) |
81 | | - |
82 | | - if "HOME" in ctx.os.environ and not ctx.os.name.startswith("windows"): |
83 | | - netrcfile = "%s/.netrc" % (ctx.os.environ["HOME"]) |
84 | | - if ctx.execute(["test", "-f", netrcfile]).return_code == 0: |
85 | | - netrc = read_netrc(ctx, netrcfile) |
86 | | - return use_netrc(netrc, urls, ctx.attr.auth_patterns) |
87 | | - |
88 | | - if "USERPROFILE" in ctx.os.environ and ctx.os.name.startswith("windows"): |
89 | | - netrcfile = "%s/.netrc" % (ctx.os.environ["USERPROFILE"]) |
90 | | - if ctx.path(netrcfile).exists: |
91 | | - netrc = read_netrc(ctx, netrcfile) |
92 | | - return use_netrc(netrc, urls, ctx.attr.auth_patterns) |
93 | | - |
94 | | - return {} |
| 81 | + else: |
| 82 | + netrc = read_user_netrc(ctx) |
| 83 | + return use_netrc(netrc, urls, ctx.attr.auth_patterns) |
95 | 84 |
|
96 | 85 | def _http_archive_impl(ctx): |
97 | 86 | """Implementation of the http_archive rule.""" |
|
0 commit comments