]>
git.proxmox.com Git - rustc.git/blob - src/etc/get-stage0.py
3 # Copyright 2016 The Rust Project Developers. See the COPYRIGHT
4 # file at the top-level directory of this distribution and at
5 # http://rust-lang.org/COPYRIGHT.
7 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10 # option. This file may not be copied, modified, or distributed
11 # except according to those terms.
16 path
= os
.path
.abspath(os
.path
.join(os
.path
.dirname(__file__
), "../bootstrap"))
22 src_root
= os
.path
.abspath(os
.path
.join(os
.path
.dirname(__file__
), "../.."))
23 data
= bootstrap
.stage0_data(src_root
)
25 channel
, date
= data
['rustc'].split('-', 1)
28 if not os
.path
.exists(dl_dir
):
31 filename
= 'rustc-{}-{}.tar.gz'.format(channel
, triple
)
32 url
= 'https://static.rust-lang.org/dist/{}/{}'.format(date
, filename
)
33 dst
= dl_dir
+ '/' + filename
34 bootstrap
.get(url
, dst
)
36 stage0_dst
= triple
+ '/stage0'
37 if os
.path
.exists(stage0_dst
):
38 for root
, _
, files
in os
.walk(stage0_dst
):
40 os
.unlink(os
.path
.join(root
, f
))
42 os
.makedirs(stage0_dst
)
43 bootstrap
.unpack(dst
, stage0_dst
, match
='rustc', verbose
=True)
45 if __name__
== '__main__':