Example #1
0
def main(triple):
    src_root = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                            "../.."))
    data = bootstrap.stage0_data(src_root)

    channel, date = data['rustc'].split('-', 1)

    dl_dir = 'dl'
    if not os.path.exists(dl_dir):
        os.makedirs(dl_dir)

    filename = 'rustc-{}-{}.tar.gz'.format(channel, triple)
    url = 'https://static.rust-lang.org/dist/{}/{}'.format(date, filename)
    dst = dl_dir + '/' + filename
    if os.path.exists(dst):
        os.unlink(dst)
    bootstrap.get(url, dst)

    stage0_dst = triple + '/stage0'
    if os.path.exists(stage0_dst):
        for root, _, files in os.walk(stage0_dst):
            for f in files:
                os.unlink(os.path.join(root, f))
    else:
        os.makedirs(stage0_dst)
    bootstrap.unpack(dst, stage0_dst, match='rustc', verbose=True)
Example #2
0
def main(argv):
    src_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
    triple = argv[1]
    data = bootstrap.stage0_data(src_root)

    channel, date = data['rustc'].split('-', 1)

    dl_dir = 'dl'
    if not os.path.exists(dl_dir):
        os.makedirs(dl_dir)

    filename_base = 'rustc-' + channel + '-' + triple
    filename = filename_base + '.tar.gz'
    url = 'https://static.rust-lang.org/dist/' + date + '/' + filename
    dst = dl_dir + '/' + filename
    if not os.path.exists(dst):
        bootstrap.get(url, dst)

    stage0_dst = triple + '/stage0'
    if os.path.exists(stage0_dst):
        for root, _, files in os.walk(stage0_dst):
            for f in files:
                os.unlink(os.path.join(root, f))
    else:
        os.makedirs(stage0_dst)
    bootstrap.unpack(dst, stage0_dst, match='rustc', verbose=True)
Example #3
0
def main(triple):
    src_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
    data = bootstrap.stage0_data(src_root)

    channel, date = data['rustc'].split('-', 1)

    dl_dir = 'dl'
    if not os.path.exists(dl_dir):
        os.makedirs(dl_dir)

    filename = 'rustc-{}-{}.tar.gz'.format(channel, triple)
    url = 'https://static.rust-lang.org/dist/{}/{}'.format(date, filename)
    dst = dl_dir + '/' + filename
    if os.path.exists(dst):
        os.unlink(dst)
    bootstrap.get(url, dst)

    stage0_dst = triple + '/stage0'
    if os.path.exists(stage0_dst):
        for root, _, files in os.walk(stage0_dst):
            for f in files:
                os.unlink(os.path.join(root, f))
    else:
        os.makedirs(stage0_dst)
    bootstrap.unpack(dst, stage0_dst, match='rustc', verbose=True)