File tree Expand file tree Collapse file tree 1 file changed +36
-12
lines changed Expand file tree Collapse file tree 1 file changed +36
-12
lines changed Original file line number Diff line number Diff line change 25
25
win64 = lines [6 ]
26
26
triple = sys .argv [1 ]
27
27
28
- if triple == 'i686-unknown-linux-gnu' :
29
- me = linux32
30
- elif triple == 'x86_64-unknown-linux-gnu' :
31
- me = linux64
32
- elif triple == 'i686-apple-darwin' :
33
- me = mac32
34
- elif triple == 'x86_64-apple-darwin' :
35
- me = mac64
36
- elif triple == 'i686-pc-windows-gnu' :
37
- me = win32
38
- elif triple == 'x86_64-pc-windows-gnu' :
39
- me = win64
28
+ ts = triple .split ('-' )
29
+ arch = ts [0 ]
30
+ if len (ts ) == 2 :
31
+ vendor = 'unknown'
32
+ target_os = ts [1 ]
40
33
else :
34
+ vendor = ts [1 ]
35
+ target_os = ts [2 ]
36
+
37
+ intel32 = (arch == 'i686' ) or (arch == 'i586' )
38
+
39
+ me = None
40
+ if target_os == 'linux' :
41
+ if intel32 :
42
+ me = linux32
43
+ new_triple = 'i686-unknown-linux-gnu'
44
+ elif arch == 'x86_64' :
45
+ me = linux64
46
+ new_triple = 'x86_64-unknown-linux-gnu'
47
+ elif target_os == 'darwin' :
48
+ if intel32 :
49
+ me = mac32
50
+ new_triple = 'i686-apple-darwin'
51
+ elif arch == 'x86_64' :
52
+ me = mac64
53
+ new_triple = 'x86_64-apple-darwin'
54
+ elif target_os == 'windows' :
55
+ if intel32 :
56
+ me = win32
57
+ new_triple = 'i686-pc-windows-gnu'
58
+ elif arch == 'x86_64' :
59
+ me = win64
60
+ new_triple = 'x86_64-pc-windows-gnu'
61
+
62
+ if me is None :
41
63
raise Exception ("no snapshot for the triple: " + triple )
42
64
65
+ triple = new_triple
66
+
43
67
platform , hash = me .strip ().split ()
44
68
45
69
tarball = 'cargo-nightly-' + triple + '.tar.gz'
You can’t perform that action at this time.
0 commit comments