Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallbacks to wget if curl not installed #1373

Merged
merged 2 commits into from
Mar 22, 2018
Merged

Fallbacks to wget if curl not installed #1373

merged 2 commits into from
Mar 22, 2018

Conversation

t-botz
Copy link
Contributor

@t-botz t-botz commented Mar 8, 2018

Tested in ubuntu docker with

  1. Both curl and wget installed
  2. only wget installed
  3. only curl installed

Console output for wget looks like this :

root@845dcc4ba103:/# wget -qO- https://raw.githubusercontent.com/thibaultdelor/rustup.rs/faa08bd786b7282500cc4162a2f428484c891130/rustup-init.sh | sh
info: downloading installer
--2018-03-08 06:54:27--  https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
Resolving static.rust-lang.org (static.rust-lang.org)... 54.230.135.47, 54.230.135.132, 54.230.135.130, ...
Connecting to static.rust-lang.org (static.rust-lang.org)|54.230.135.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12984456 (12M) [application/x-sharedlib]
Saving to: '/tmp/tmp.DQhaNqhC4q/rustup-init'

/tmp/tmp.DQhaNqhC4q/rustu 100%[==================================>]  12.38M  11.0MB/s    in 1.1s    

2018-03-08 06:54:29 (11.0 MB/s) - '/tmp/tmp.DQhaNqhC4q/rustup-init' saved [12984456/12984456]


Welcome to Rust!

This will download and install the official compiler for the Rust programming 
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin 
directory, located at:

  /root/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /root/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

ruihe774 and others added 2 commits March 8, 2018 16:32
modify 'rustup-init.sh' to support wget
if curl not installed. This situation
often happens on some linux distribution.
@t-botz
Copy link
Contributor Author

t-botz commented Mar 8, 2018

@titansnow I slightly modified your version to avoid duplication of command -v. That way we are sure to be consistent on how we test existence of a command but also we might want to not use it because -v|-V is not POSIX 2004 compliant.

r? @alexcrichton @nrc

@t-botz
Copy link
Contributor Author

t-botz commented Mar 8, 2018

If approved, should close #1346 and #1268

@ghost
Copy link

ghost commented Mar 9, 2018

Looks good 😄

@nrc
Copy link
Member

nrc commented Mar 22, 2018

Looks good to me. r? @alexcrichton

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Mar 22, 2018

📌 Commit faa08bd has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Mar 22, 2018

⌛ Testing commit faa08bd with merge 76beb88...

bors added a commit that referenced this pull request Mar 22, 2018
 Fallbacks to wget if curl not installed

Tested in ubuntu docker with
 1. Both curl and wget installed
 2. only wget installed
 3. only curl installed

Console output for wget looks like this :
```shell
root@845dcc4ba103:/# wget -qO- https://raw.githubusercontent.com/thibaultdelor/rustup.rs/faa08bd786b7282500cc4162a2f428484c891130/rustup-init.sh | sh
info: downloading installer
--2018-03-08 06:54:27--  https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
Resolving static.rust-lang.org (static.rust-lang.org)... 54.230.135.47, 54.230.135.132, 54.230.135.130, ...
Connecting to static.rust-lang.org (static.rust-lang.org)|54.230.135.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12984456 (12M) [application/x-sharedlib]
Saving to: '/tmp/tmp.DQhaNqhC4q/rustup-init'

/tmp/tmp.DQhaNqhC4q/rustu 100%[==================================>]  12.38M  11.0MB/s    in 1.1s

2018-03-08 06:54:29 (11.0 MB/s) - '/tmp/tmp.DQhaNqhC4q/rustup-init' saved [12984456/12984456]

Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

  /root/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /root/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

```
@bors
Copy link
Contributor

bors commented Mar 22, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 76beb88 to master...

@bors bors merged commit faa08bd into rust-lang:master Mar 22, 2018
@t-botz t-botz mentioned this pull request Mar 29, 2018
@t-botz t-botz deleted the wgetsupport branch August 6, 2018 00:46
AJ-Ianozi pushed a commit to AJ-Ianozi/getada-download that referenced this pull request Oct 12, 2023
 Fallbacks to wget if curl not installed

Tested in ubuntu docker with
 1. Both curl and wget installed
 2. only wget installed
 3. only curl installed

Console output for wget looks like this :
```shell
root@845dcc4ba103:/# wget -qO- https://raw.githubusercontent.com/thibaultdelor/rustup.rs/ba8e1a8988c00a3f7a2e5ddc4b2a4959bc071b8c/rustup-init.sh | sh
info: downloading installer
--2018-03-08 06:54:27--  https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
Resolving static.rust-lang.org (static.rust-lang.org)... 54.230.135.47, 54.230.135.132, 54.230.135.130, ...
Connecting to static.rust-lang.org (static.rust-lang.org)|54.230.135.47|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12984456 (12M) [application/x-sharedlib]
Saving to: '/tmp/tmp.DQhaNqhC4q/rustup-init'

/tmp/tmp.DQhaNqhC4q/rustu 100%[==================================>]  12.38M  11.0MB/s    in 1.1s

2018-03-08 06:54:29 (11.0 MB/s) - '/tmp/tmp.DQhaNqhC4q/rustup-init' saved [12984456/12984456]

Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

  /root/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /root/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants