Skip to content

Commit 943b7b7

Browse files
committed
build: Follow up cleanup and rename stuffs
1 parent 7576ad5 commit 943b7b7

File tree

10 files changed

+30
-43
lines changed

10 files changed

+30
-43
lines changed

.travis.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,14 @@ matrix:
7373
if: branch != master
7474
env: MACOSX_DEPLOYMENT_TARGET=10.7 TARGET=i686-apple-darwin
7575

76-
- name: clippy/rustup-init.sh
76+
- name: rustfmt/clippy/rustup-init.sh/shellcheck
7777
language: minimal
7878
install:
7979
- |
8080
sh ./rustup-init.sh --default-toolchain=beta -y;
8181
. "$HOME"/.cargo/env;
82-
rustup component add clippy;
82+
rustup component add rustfmt clippy;
8383
script:
84-
- cargo clippy --all --all-targets
8584
- |
8685
docker run \
8786
--volume "$TRAVIS_BUILD_DIR":/checkout:ro \
@@ -90,6 +89,11 @@ matrix:
9089
-it \
9190
centos:6 \
9291
sh ./ci/raw_init.sh;
92+
- shellcheck -s dash -- rustup-init.sh;
93+
- git ls-files -- '*.sh' | xargs shellcheck -s dash -e SC1090;
94+
- git ls-files -- '*.bash' | xargs shellcheck -s bash -e SC1090;
95+
- cargo fmt --all -- --check;
96+
- cargo clippy --all --all-targets
9397
before_deploy:
9498
deploy:
9599

@@ -120,23 +124,13 @@ script:
120124
esac
121125
- |
122126
if [ -n "$DOCKER" ]; then
123-
sh ci/build-run-docker.sh "$DOCKER" "$TARGET" "$SKIP_TESTS";
127+
bash ci/build-run-docker.bash "$DOCKER" "$TARGET" "$SKIP_TESTS";
124128
else
125-
sh ci/run.sh;
126-
fi
127-
128-
# Check the formatting last because test failures are more interesting to have
129-
# discovered for contributors lacking some platform access for testing beforehand
130-
- |
131-
if [ "${TARGET}" = x86_64-unknown-linux-gnu ]; then
132-
shellcheck -s dash -e SC1090 -- rustup-init.sh ci/*.sh;
133-
rustup component add rustfmt;
134-
rustfmt -vV;
135-
cargo fmt --all -- --check;
129+
bash ci/run.bash;
136130
fi
137131
138132
before_deploy:
139-
- sh ci/prepare-deploy-travis.sh
133+
- bash ci/prepare-deploy-travis.bash
140134

141135
deploy:
142136
- provider: s3

ci/build-run-docker.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
script_dir=$(cd "$(dirname "$0")" && pwd)
44
root_dir="${script_dir}/.."
55

6-
. "${script_dir}/shared.sh"
6+
. "${script_dir}/shared.bash"
77

88
set -e
99
# Disable cause it makes shared script not to work properly
@@ -19,7 +19,7 @@ SKIP_TESTS="$3"
1919

2020
travis_fold start "fetch.image.${TARGET}"
2121
travis_time_start
22-
travis_do_cmd sh ci/fetch-rust-docker.sh "${TARGET}"
22+
travis_do_cmd bash ci/fetch-rust-docker.bash "${TARGET}"
2323
travis_time_finish
2424
travis_fold end "fetch.image.${TARGET}"
2525

@@ -52,7 +52,7 @@ docker run \
5252
--init \
5353
--rm \
5454
"${DOCKER}" \
55-
-c 'PATH="${PATH}":/rustc-sysroot/bin sh ci/run.sh'
55+
-c 'PATH="${PATH}":/rustc-sysroot/bin bash ci/run.bash'
5656

5757
# check that rustup-init was built with ssl support
5858
# see https://github.com/rust-lang/rustup.rs/issues/1051

ci/deploy.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
# Usage:
66
#
77
# 1. Deploy the release on the dev environment:
8-
# ./deploy.sh dev VERSION_NUMBER
8+
# ./deploy.bash dev VERSION_NUMBER
99
#
1010
# 2. Test everything works correctly:
1111
# RUSTUP_UPDATE_ROOT=https://dev-static.rust-lang.org/rustup rustup self update
1212
#
1313
# 3. Deploy the release to the prod environment:
14-
# ./deploy.sh prod VERSION_NUMBER
14+
# ./deploy.bash prod VERSION_NUMBER
1515

1616
set -euo pipefail
1717
IFS=$'\n\t'

ci/docker/android/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ RUN apt-get update && \
1111
make \
1212
pkg-config
1313

14-
COPY ci/docker/scripts/sccache.sh /scripts/
15-
RUN sh /scripts/sccache.sh
14+
COPY ci/docker/scripts/sccache.bash /scripts/
15+
RUN bash /scripts/sccache.bash
1616

1717
RUN apt-get install -y --no-install-recommends \
1818
unzip \

ci/docker/x86_64-unknown-linux-musl/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:18.04
22

3-
COPY ci/docker/scripts/sccache.sh /scripts/
3+
COPY ci/docker/scripts/sccache.bash /scripts/
44

55
RUN \
66
apt-get update && \
@@ -12,4 +12,4 @@ RUN \
1212
perl \
1313
make \
1414
gcc && \
15-
sh /scripts/sccache.sh
15+
bash /scripts/sccache.bash

ci/fetch-rust-docker.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
script_dir=$(cd "$(dirname "$0")" && pwd)
4-
. "$script_dir/shared.sh"
4+
. "$script_dir/shared.bash"
55

66
set -e
77
# Disable cause it makes shared script not to work properly

ci/prepare-deploy-travis.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ "$TRAVIS_PULL_REQUEST" = "true" ] || [ "$TRAVIS_BRANCH" = "auto" ]; then
77
fi
88

99
# Copy rustup-init to rustup-setup for backwards compatibility
10-
cp target/"$TARGET"/release/rustup-init$EXE_EXT target/"$TARGET"/release/rustup-setup$EXE_EXT
10+
cp target/"$TARGET"/release/rustup-init"${EXE_EXT}" target/"$TARGET"/release/rustup-setup"${EXE_EXT}"
1111

1212
# Generate hashes
1313
if [ "$TRAVIS_OS_NAME" = "osx" ]; then

ci/run.bash

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -ex
44

5-
RUST_BACKTRACE=1
6-
export RUST_BACKTRACE
5+
export RUST_BACKTRACE=1
76

87
rustc -vV
98
cargo -vV
109

11-
if [ "$TRAVIS_OS_NAME" = "windows" ]; then
12-
FEATURES=""
13-
else
14-
FEATURES="--features vendored-openssl"
10+
FEATURES=()
11+
if [ "$TRAVIS_OS_NAME" != "windows" ]; then
12+
FEATURES=('--features' 'vendored-openssl')
1513
fi
1614

17-
# Sadly we need word splitting for $FEATURES
18-
# shellcheck disable=SC2086
19-
cargo build --locked -v --release --target "$TARGET" $FEATURES
15+
cargo build --locked -v --release --target "$TARGET" "${FEATURES[@]}"
2016

2117
runtest () {
22-
# shellcheck disable=SC2086
23-
cargo test --release --target "$TARGET" $FEATURES "$@"
18+
cargo test --release --target "$TARGET" "${FEATURES[@]}" "$@"
2419
}
2520

2621
if [ -z "$SKIP_TESTS" ]; then
27-
# shellcheck disable=SC2086
28-
cargo run --locked --release --target "$TARGET" $FEATURES -- --dump-testament
22+
cargo run --locked --release --target "$TARGET" "${FEATURES[@]}" -- --dump-testament
2923
runtest -p download
3024
runtest --bin rustup-init
3125
runtest --lib --all

ci/shared.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ travis_nanoseconds() {
4949
local cmd='date'
5050
local format='+%s%N'
5151

52-
if command -v gdate >/dev/null 2>&1; then
52+
if command -v gdate >/dev/null; then
5353
cmd='gdate'
5454
elif [ "$(uname)" = Darwin ]; then
5555
format='+%s000000000'

src/cli/download_tracker.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,5 +267,4 @@ mod tests {
267267

268268
assert_eq!(DownloadTracker::from_seconds(222_292), (2, 13, 44, 52));
269269
}
270-
271270
}

0 commit comments

Comments
 (0)