build-package.sh: fix unbound variable $TERMUX_RUST_VERSION

This commit is contained in:
Leonid Pliushch 2021-01-10 14:33:00 +02:00 committed by GitHub
parent 29d48878c4
commit 8141194887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,9 +34,9 @@ termux_setup_rust() {
curl https://sh.rustup.rs -sSf > $TERMUX_PKG_TMPDIR/rustup.sh
if [ -z $TERMUX_RUST_VERSION ]; then
if [ -z "${TERMUX_RUST_VERSION-}" ]; then
TERMUX_RUST_VERSION=$(bash -c ". $TERMUX_SCRIPTDIR/packages/rust/build.sh; echo \$TERMUX_PKG_VERSION")
fi
fi
sh $TERMUX_PKG_TMPDIR/rustup.sh -y --default-toolchain $TERMUX_RUST_VERSION
export PATH=$HOME/.cargo/bin:$PATH