Created
September 20, 2015 21:33
-
-
Save timcharper/aec864dafb615e8a9eba to your computer and use it in GitHub Desktop.
multirust source downloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save this file to ~/.multirust/Makefile | |
# to run, cd ~/.multirust; make toolchains/1.3.0/src | |
.PHONY: clean | |
rust.git: | |
git clone https://github.com/rust-lang/rust.git --bare | |
toolchains/nightly/src: toolchains/master/src | |
ln -sf $$(pwd)/toolchains/master/src $$(pwd)/$@ | |
toolchains/%/src: rust.git | |
(cd rust.git; git fetch) | |
rm -rf ./toolchains/$*/tmp | |
mkdir -p ./toolchains/$*/tmp | |
git archive --remote rust.git $* ./src --format tar | tar x -C ./toolchains/$*/tmp | |
[ -d ./toolchains/$*/tmp ] | |
mv ./toolchains/$*/tmp/src $@ | |
rmdir ./toolchains/$*/tmp | |
touch $@ | |
clean: | |
rm -rf ./toolchains/*/src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment