rustup: update to 1.25.1.

This commit is contained in:
Jan Christian Grünhage 2022-07-12 08:38:23 +02:00 committed by classabbyamp
parent c88f24302c
commit f1f6c1acb3
3 changed files with 47 additions and 17 deletions

View File

@ -0,0 +1,45 @@
From e512f8222fddecf23552ed490f71cc3c444abc53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?=
<jan.christian@gruenhage.xyz>
Date: Tue, 12 Jul 2022 08:16:08 +0200
Subject: [PATCH] Symlink rustup instead of copying it
To make sure that we can update rustup using xbps, we need to symlink
rustup into $CARGO_HOME/bin instead of copying it.
Upstream doesn't want the patch as it is right now.
---
src/cli/self_update.rs | 3 +--
src/utils/utils.rs | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/cli/self_update.rs b/src/cli/self_update.rs
index a4c00d57..82a4d67a 100644
--- a/src/cli/self_update.rs
+++ b/src/cli/self_update.rs
@@ -729,8 +729,7 @@ fn install_bins() -> Result<()> {
if rustup_path.exists() {
utils::remove_file("rustup-bin", &rustup_path)?;
}
- utils::copy_file(&this_exe_path, &rustup_path)?;
- utils::make_executable(&rustup_path)?;
+ utils::symlink_file(&this_exe_path, &rustup_path)?;
install_proxies()
}
diff --git a/src/utils/utils.rs b/src/utils/utils.rs
index 0362372b..9e5a5fe2 100644
--- a/src/utils/utils.rs
+++ b/src/utils/utils.rs
@@ -306,7 +306,7 @@ pub fn hardlink_file(src: &Path, dest: &Path) -> Result<()> {
}
#[cfg(unix)]
-fn symlink_file(src: &Path, dest: &Path) -> Result<()> {
+pub(crate) fn symlink_file(src: &Path, dest: &Path) -> Result<()> {
std::os::unix::fs::symlink(src, dest).with_context(|| RustupError::LinkingFile {
src: PathBuf::from(src),
dest: PathBuf::from(dest),
--
2.37.0

View File

@ -1,15 +0,0 @@
Upstream: No, not upstreamable like this
Reason: We want the rustup binary in $CARGO_HOME/bin to be of the
same version as the one we distribute in this rustup package.
--- a/src/cli/self_update.rs 2019-05-27 16:17:21.432715136 +0200
+++ b/src/cli/self_update.rs 2019-05-27 16:18:56.537718683 +0200
@@ -619,8 +619,7 @@
if rustup_path.exists() {
utils::remove_file("rustup-bin", &rustup_path)?;
}
- utils::copy_file(&this_exe_path, &rustup_path)?;
- utils::make_executable(&rustup_path)?;
+ utils::symlink_file(&this_exe_path, &rustup_path)?;
install_proxies()
}

View File

@ -1,6 +1,6 @@
# Template file for 'rustup' # Template file for 'rustup'
pkgname=rustup pkgname=rustup
version=1.24.3 version=1.25.1
revision=1 revision=1
# rustup doesn't recognize this target # rustup doesn't recognize this target
archs="~armv*-musl" archs="~armv*-musl"
@ -15,7 +15,7 @@ maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
license="Apache-2.0, MIT" license="Apache-2.0, MIT"
homepage="https://www.rustup.rs" homepage="https://www.rustup.rs"
distfiles="https://github.com/rust-lang/${pkgname}/archive/${version}.tar.gz" distfiles="https://github.com/rust-lang/${pkgname}/archive/${version}.tar.gz"
checksum=24a8cede4ccbbf45ab7b8de141d92f47d1881bb546b3b9180d5a51dc0622d0f6 checksum=4d062c77b08309bd212f22dd7da1957c1882509c478e57762f34ec4fb2884c9a
case "$XBPS_TARGET_MACHINE" in case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*|arm*|aarch64*) x86_64*|i686*|arm*|aarch64*)