mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
rustup.rs: update to 1.16.0
This commit is contained in:
parent
3565115029
commit
f24737b24a
@ -2,8 +2,8 @@
|
|||||||
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
PKG_NAME="rustup.rs"
|
PKG_NAME="rustup.rs"
|
||||||
PKG_VERSION="1.3.0"
|
PKG_VERSION="1.16.0"
|
||||||
PKG_SHA256="c0ca06b70104fed8f1de5a6f5ecfd8478e8bc03f15add8d7896b86b3b15e81e3"
|
PKG_SHA256="8c4ffeda2088dbdd5ea2eac8acef5ddd57dfcfe1f06a503e3da790f93161e1a6"
|
||||||
PKG_LICENSE="MIT"
|
PKG_LICENSE="MIT"
|
||||||
PKG_SITE="https://www.rust-lang.org"
|
PKG_SITE="https://www.rust-lang.org"
|
||||||
PKG_URL="https://github.com/rust-lang-nursery/rustup.rs/archive/$PKG_VERSION.tar.gz"
|
PKG_URL="https://github.com/rust-lang-nursery/rustup.rs/archive/$PKG_VERSION.tar.gz"
|
||||||
|
@ -1,115 +0,0 @@
|
|||||||
From 299427ade578adb04a761ebbe7aacc07367fe37a Mon Sep 17 00:00:00 2001
|
|
||||||
From: TitanSnow <sweeto@live.cn>
|
|
||||||
Date: Sat, 21 Oct 2017 13:08:33 +0800
|
|
||||||
Subject: [PATCH 1/2] fallbacks to wget if curl not installed
|
|
||||||
|
|
||||||
modify 'rustup-init.sh' to support wget
|
|
||||||
if curl not installed. This situation
|
|
||||||
often happens on some linux distribution.
|
|
||||||
---
|
|
||||||
rustup-init.sh | 28 ++++++++++++++++++++++++----
|
|
||||||
1 file changed, 24 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/rustup-init.sh b/rustup-init.sh
|
|
||||||
index 7e089a1fb..a33a31377 100755
|
|
||||||
--- a/rustup-init.sh
|
|
||||||
+++ b/rustup-init.sh
|
|
||||||
@@ -9,8 +9,8 @@
|
|
||||||
# option. This file may not be copied, modified, or distributed
|
|
||||||
# except according to those terms.
|
|
||||||
|
|
||||||
-# This is just a little script that can be curled from the internet to
|
|
||||||
-# install rustup. It just does platform detection, curls the installer
|
|
||||||
+# This is just a little script that can be downloaded from the internet to
|
|
||||||
+# install rustup. It just does platform detection, downloads the installer
|
|
||||||
# and runs it.
|
|
||||||
|
|
||||||
set -u
|
|
||||||
@@ -41,8 +41,8 @@ EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
+ downloader --check
|
|
||||||
need_cmd uname
|
|
||||||
- need_cmd curl
|
|
||||||
need_cmd mktemp
|
|
||||||
need_cmd chmod
|
|
||||||
need_cmd mkdir
|
|
||||||
@@ -100,7 +100,7 @@ main() {
|
|
||||||
fi
|
|
||||||
|
|
||||||
ensure mkdir -p "$_dir"
|
|
||||||
- ensure curl -sSfL "$_url" -o "$_file"
|
|
||||||
+ ensure downloader "$_url" "$_file"
|
|
||||||
ensure chmod u+x "$_file"
|
|
||||||
if [ ! -x "$_file" ]; then
|
|
||||||
printf '%s\n' "Cannot execute $_file (likely because of mounting /tmp as noexec)." 1>&2
|
|
||||||
@@ -359,4 +359,24 @@ ignore() {
|
|
||||||
"$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
+# This wraps curl or wget. Try curl first, if not installed,
|
|
||||||
+# use wget instead.
|
|
||||||
+downloader() {
|
|
||||||
+ if command -v curl > /dev/null 2>&1
|
|
||||||
+ then _dld=curl
|
|
||||||
+ elif command -v wget > /dev/null 2>&1
|
|
||||||
+ then _dld=wget
|
|
||||||
+ else _dld='curl or wget' # to be used in error message of need_cmd
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ if [ "$1" = --check ]
|
|
||||||
+ then need_cmd "$_dld"
|
|
||||||
+ elif [ "$_dld" = curl ]
|
|
||||||
+ then curl -sSfL "$1" -o "$2"
|
|
||||||
+ elif [ "$_dld" = wget ]
|
|
||||||
+ then wget "$1" -O "$2"
|
|
||||||
+ else err "Unknown downloader" # should not reach here
|
|
||||||
+ fi
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
main "$@" || exit 1
|
|
||||||
|
|
||||||
From faa08bd786b7282500cc4162a2f428484c891130 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Tibo <delor.thibault@gmail.com>
|
|
||||||
Date: Thu, 8 Mar 2018 16:41:19 +1100
|
|
||||||
Subject: [PATCH 2/2] Avoid duplication of command -v
|
|
||||||
|
|
||||||
---
|
|
||||||
rustup-init.sh | 11 ++++++++---
|
|
||||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/rustup-init.sh b/rustup-init.sh
|
|
||||||
index a33a31377..e874aa7a3 100755
|
|
||||||
--- a/rustup-init.sh
|
|
||||||
+++ b/rustup-init.sh
|
|
||||||
@@ -331,11 +331,16 @@ err() {
|
|
||||||
}
|
|
||||||
|
|
||||||
need_cmd() {
|
|
||||||
- if ! command -v "$1" > /dev/null 2>&1
|
|
||||||
+ if ! check_cmd "$1"
|
|
||||||
then err "need '$1' (command not found)"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
+check_cmd() {
|
|
||||||
+ command -v "$1" > /dev/null 2>&1
|
|
||||||
+ return $?
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
need_ok() {
|
|
||||||
if [ $? != 0 ]; then err "$1"; fi
|
|
||||||
}
|
|
||||||
@@ -362,9 +367,9 @@ ignore() {
|
|
||||||
# This wraps curl or wget. Try curl first, if not installed,
|
|
||||||
# use wget instead.
|
|
||||||
downloader() {
|
|
||||||
- if command -v curl > /dev/null 2>&1
|
|
||||||
+ if check_cmd curl
|
|
||||||
then _dld=curl
|
|
||||||
- elif command -v wget > /dev/null 2>&1
|
|
||||||
+ elif check_cmd wget
|
|
||||||
then _dld=wget
|
|
||||||
else _dld='curl or wget' # to be used in error message of need_cmd
|
|
||||||
fi
|
|
Loading…
x
Reference in New Issue
Block a user