Skip to content

Commit 1a40065

Browse files
committed
Merge pull request #303 from brson/rustup-init
Rustup init
2 parents 2c4a188 + ce3f464 commit 1a40065

10 files changed

+127
-100
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ path = "src/rustup/lib.rs"
6464
test = false # no unit tests
6565

6666
[[bin]]
67-
name = "rustup-setup"
67+
name = "rustup-init"
6868
path = "src/rustup-cli/main.rs"
6969
test = false # no unit tests

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -379,34 +379,34 @@ documentation for [multirust] and [multirust-dist].
379379
The primary installation method, as described at
380380
[www.rustup.rs](https://www.rustup.rs), differs by platform:
381381

382-
* On Windows, download and run the [rustup-setup.exe for the
382+
* On Windows, download and run the [rustup-init.exe for the
383383
`i686-pc-windows-gnu` target][setup]. Although this build of
384384
`rustup` installs compilers targeting the GNU ABI by default,
385385
compilers targetting the MSVC ABI can be installed with e.g. `rustup
386386
update stable-msvc`.
387387
* On Unix, run `curl https://sh.rustup.rs -sSf | sh` in your
388388
shell. This downloads and runs the correct version of
389-
`rustup-setup` for your platform.
389+
`rustup-init` for your platform.
390390

391-
[setup]: https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-setup.exe
391+
[setup]: https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe
392392

393-
If you prefer you can directly download `rustup-setup` for the
393+
If you prefer you can directly download `rustup-init` for the
394394
platform of your choice:
395395

396-
- [aarch64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/aarch64-unknown-linux-gnu/rustup-setup)
397-
- [arm-unknown-linux-gnueabi](https://static.rust-lang.org/rustup/dist/arm-unknown-linux/rustup-setup)
398-
- [arm-unknown-linux-gnueabihf](https://static.rust-lang.org/rustup/dist/arm-unknown-linux-gnueabihf/rustup-setup)
399-
- [armv7-unknown-linux-gnueabihf](https://static.rust-lang.org/rustup/dist/armv7-unknown-linux-gnueabihf/rustup-setup)
400-
- [i686-apple-darwin](https://static.rust-lang.org/rustup/dist/i686-apple-darwin/rustup-setup)
401-
- [i686-pc-windows-gnu](https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-setup.exe)
402-
- [i686-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-setup.exe)<sup>[](#vs2015)</sup>
403-
- [i686-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/i686-unknown-linux-gnu/rustup-setup)
404-
- [x86_64-apple-darwin](https://static.rust-lang.org/rustup/dist/x86_64-apple-darwin/rustup-setup)
405-
- [x86_64-pc-windows-gnu](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-setup.exe)
406-
- [x86_64-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-setup.exe)<sup>[](#vs2015)</sup>
407-
- [x86_64-unknown-freebsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-freebsd/rustup-setup)
408-
- [x86_64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-setup)
409-
- [x86_64-unknown-netbsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-netbsd/rustup-setup)
396+
- [aarch64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/aarch64-unknown-linux-gnu/rustup-init)
397+
- [arm-unknown-linux-gnueabi](https://static.rust-lang.org/rustup/dist/arm-unknown-linux/rustup-init)
398+
- [arm-unknown-linux-gnueabihf](https://static.rust-lang.org/rustup/dist/arm-unknown-linux-gnueabihf/rustup-init)
399+
- [armv7-unknown-linux-gnueabihf](https://static.rust-lang.org/rustup/dist/armv7-unknown-linux-gnueabihf/rustup-init)
400+
- [i686-apple-darwin](https://static.rust-lang.org/rustup/dist/i686-apple-darwin/rustup-init)
401+
- [i686-pc-windows-gnu](https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe)
402+
- [i686-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/i686-pc-windows-msvc/rustup-init.exe)<sup>[](#vs2015)</sup>
403+
- [i686-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/i686-unknown-linux-gnu/rustup-init)
404+
- [x86_64-apple-darwin](https://static.rust-lang.org/rustup/dist/x86_64-apple-darwin/rustup-init)
405+
- [x86_64-pc-windows-gnu](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe)
406+
- [x86_64-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe)<sup>[](#vs2015)</sup>
407+
- [x86_64-unknown-freebsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-freebsd/rustup-init)
408+
- [x86_64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init)
409+
- [x86_64-unknown-netbsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-netbsd/rustup-init)
410410

411411
<a name="vs2015">†</a>
412412
MSVC builds of `rustup` additionally require an [installation of

appveyor.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ after_test:
5454
- powershell -File ci/prepare-deploy-appveyor.ps1
5555

5656
artifacts:
57+
- path: dist\$(TARGET)\rustup-init.exe
58+
name: rustup-init
59+
- path: dist\$(TARGET)\rustup-init.exe.sha256
60+
name: rustup-init-sha
5761
- path: dist\$(TARGET)\rustup-setup.exe
5862
name: rustup-setup
5963
- path: dist\$(TARGET)\rustup-setup.exe.sha256
@@ -68,7 +72,7 @@ deploy:
6872
bucket: dev-static-rust-lang-org
6973
set_public: true
7074
region: us-west-1
71-
artifact: rustup-setup,rustup-setup-sha
75+
artifact: rustup-init,rustup-init-sha,rustup-setup,rustup-setup-sha
7276
folder: rustup
7377
on:
7478
branch: master
@@ -81,7 +85,7 @@ deploy:
8185
bucket: static-rust-lang-org
8286
set_public: true
8387
region: us-west-1
84-
artifact: rustup-setup,rustup-setup-sha
88+
artifact: rustup-init,rustup-init-sha,rustup-setup,rustup-setup-sha
8589
folder: rustup
8690
on:
8791
branch: stable

ci/prepare-deploy-appveyor.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ if ($env:APPVEYOR_REPO_BRANCH -eq "auto") {
66
exit 0
77
}
88

9+
# Copy rustup-init to rustup-setup for backwards compatibility
10+
cp target\release\rustup-init.exe target\release\rustup-setup.exe
11+
912
# Generate hashes
1013
Get-FileHash .\target\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
1114

1215
# Prepare bins for upload
1316
$dest = "dist\$env:TARGET"
1417
md -Force "$dest"
18+
cp target\release\rustup-init.exe "$dest/"
19+
cp target\release\rustup-init.exe.sha256 "$dest/"
1520
cp target\release\rustup-setup.exe "$dest/"
1621
cp target\release\rustup-setup.exe.sha256 "$dest/"
1722

ci/prepare-deploy-travis.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ if [[ "$TARGET" == "x86_64-unknown-linux-gnu" && "$TRAVIS_BRANCH" == "stable" ]]
2323
#git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages;
2424
fi;
2525

26+
# Copy rustup-init to rustup-setup for backwards compatibility
27+
cp target/$TARGET/release/rustup-init target/$TARGET/release/rustup-setup
28+
2629
# Generate hashes
2730
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
2831
find "target/$TARGET/release/" -maxdepth 1 -type f -exec sh -c 'shasum -a 256 -b "{}" > "{}.sha256"' \;;
@@ -36,14 +39,16 @@ dest="deploy"
3639
# Prepare bins for upload
3740
bindest="$dest/dist/$TARGET"
3841
mkdir -p "$bindest/"
42+
cp target/$TARGET/release/rustup-init "$bindest/"
43+
cp target/$TARGET/release/rustup-init.sha256 "$bindest/"
3944
cp target/$TARGET/release/rustup-setup "$bindest/"
4045
cp target/$TARGET/release/rustup-setup.sha256 "$bindest/"
4146

4247
if [ "$TARGET" != "x86_64-unknown-linux-gnu" ]; then
4348
exit 0
4449
fi
4550

46-
cp rustup-setup.sh "$dest/"
51+
cp rustup-init.sh "$dest/"
4752

4853
# Prepare website for upload
4954
cp -R www "$dest/www"

rustup-setup.sh renamed to rustup-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ main() {
3737
;;
3838
esac
3939

40-
local _url="$RUSTUP_UPDATE_ROOT/$_arch/rustup-setup$_ext"
40+
local _url="$RUSTUP_UPDATE_ROOT/$_arch/rustup-init$_ext"
4141

4242
local _dir="$(mktemp -d 2>/dev/null || ensure mktemp -d -t rustup)"
43-
local _file="$_dir/rustup-setup$_ext"
43+
local _file="$_dir/rustup-init$_ext"
4444

4545
printf "\33[1minfo:\33[0m downloading installer\n"
4646

src/rustup-cli/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ fn run_multirust() -> Result<()> {
7676
multirust_mode::main()
7777
}
7878
Some(n) if n.starts_with("multirust-setup")||
79-
n.starts_with("rustup-setup") => {
79+
n.starts_with("rustup-setup") ||
80+
n.starts_with("rustup-init") => {
8081
// NB: The above check is only for the prefix of the file
8182
// name. Browsers rename duplicates to
8283
// e.g. multirust-setup(2), and this allows all variations

src/rustup-cli/self_update.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ pub fn update() -> Result<()> {
875875
pub fn prepare_update() -> Result<Option<PathBuf>> {
876876
let ref cargo_home = try!(utils::cargo_home());
877877
let ref multirust_path = cargo_home.join(&format!("bin/multirust{}", EXE_SUFFIX));
878-
let ref setup_path = cargo_home.join(&format!("bin/rustup-setup{}", EXE_SUFFIX));
878+
let ref setup_path = cargo_home.join(&format!("bin/rustup-init{}", EXE_SUFFIX));
879879

880880
if !multirust_path.exists() {
881881
return Err(Error::NotSelfInstalled(cargo_home.clone()));
@@ -898,7 +898,7 @@ pub fn prepare_update() -> Result<Option<PathBuf>> {
898898
}));
899899

900900
// Get download URL
901-
let url = format!("{}/{}/rustup-setup{}", update_root, triple, EXE_SUFFIX);
901+
let url = format!("{}/{}/rustup-init{}", update_root, triple, EXE_SUFFIX);
902902

903903
// Calculate own hash
904904
let mut hasher = Hasher::new(Type::SHA256);
@@ -1009,7 +1009,7 @@ pub fn self_replace() -> Result<()> {
10091009

10101010
pub fn cleanup_self_updater() -> Result<()> {
10111011
let cargo_home = try!(utils::cargo_home());
1012-
let ref setup = cargo_home.join(&format!("bin/rustup-setup{}", EXE_SUFFIX));
1012+
let ref setup = cargo_home.join(&format!("bin/rustup-init{}", EXE_SUFFIX));
10131013

10141014
if setup.exists() {
10151015
try!(utils::remove_file("setup", setup));

src/rustup-mock/src/clitools.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ pub fn setup(s: Scenario, f: &Fn(&Config)) {
8484

8585
let current_exe_path = env::current_exe().map(PathBuf::from).unwrap();
8686
let exe_dir = current_exe_path.parent().unwrap();
87-
let ref build_path = exe_dir.join(format!("rustup-setup{}", EXE_SUFFIX));
87+
let ref build_path = exe_dir.join(format!("rustup-init{}", EXE_SUFFIX));
8888

8989
let ref rustup_path = config.exedir.join(format!("rustup{}", EXE_SUFFIX));
90-
let setup_path = config.exedir.join(format!("rustup-setup{}", EXE_SUFFIX));
90+
let setup_path = config.exedir.join(format!("rustup-init{}", EXE_SUFFIX));
9191
let multirust_setup_path = config.exedir.join(format!("multirust-setup{}", EXE_SUFFIX));
9292
let rustc_path = config.exedir.join(format!("rustc{}", EXE_SUFFIX));
9393
let cargo_path = config.exedir.join(format!("cargo{}", EXE_SUFFIX));

0 commit comments

Comments
 (0)