From 2c5a644375b2458abcdcb65a254c15f6a158937d Mon Sep 17 00:00:00 2001 From: si-gui Date: Wed, 23 Jun 2021 14:52:35 +0800 Subject: [PATCH 1/2] clippy-driver usage should user friendly (cherry picked from commit bbe90e9fd6cba7fa6eb1cf250fd8cd60bf1d6783) --- ...py-driver-usage-should-user-friendly.patch | 25 +++++++++++++++++++ rust.spec | 7 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 clippy-driver-usage-should-user-friendly.patch diff --git a/clippy-driver-usage-should-user-friendly.patch b/clippy-driver-usage-should-user-friendly.patch new file mode 100644 index 0000000..d618974 --- /dev/null +++ b/clippy-driver-usage-should-user-friendly.patch @@ -0,0 +1,25 @@ +From 1062e11170d93df3c53b01c1a630a7151af3a003 Mon Sep 17 00:00:00 2001 +From: si-gui +Date: Wed, 23 Jun 2021 14:36:09 +0800 +Subject: [PATCH] clippy-driver usage should user friendly + +--- + src/tools/clippy/src/driver.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tools/clippy/src/driver.rs b/src/tools/clippy/src/driver.rs +index f5f6c09e..7af74f15 100644 +--- a/src/tools/clippy/src/driver.rs ++++ b/src/tools/clippy/src/driver.rs +@@ -95,7 +95,7 @@ fn display_help() { + Checks a package to catch common mistakes and improve your Rust code. + + Usage: +- cargo clippy [options] [--] [...] ++ clippy-driver [options] [--] [...] + + Common options: + -h, --help Print this message +-- +2.30.0 + diff --git a/rust.spec b/rust.spec index 1f538aa..eabc677 100644 --- a/rust.spec +++ b/rust.spec @@ -12,7 +12,7 @@ %bcond_without lldb Name: rust Version: 1.51.0 -Release: 1 +Release: 2 Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) URL: https://www.rust-lang.org @@ -35,6 +35,7 @@ Patch0006: rustc-1.51.0-backport-pr81728.patch Patch0007: rustc-1.51.0-backport-pr83629.patch Patch0008: rustc-1.48.0-disable-libssh2.patch Patch0009: rustc-1.51.0-disable-http2.patch +Patch0010: clippy-driver-usage-should-user-friendly.patch %{lua: function rust_triple(arch) local abi = "gnu" if arch == "armv7hl" then @@ -254,6 +255,7 @@ sed -i.try-python -e '/^try python3 /i try "%{python}" "$@"' ./configure rm -rf src/llvm-project/ mkdir -p src/llvm-project/libunwind/ %endif +%patch0010 -p1 rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ rm -rf vendor/libssh2-sys/libssh2/ @@ -461,6 +463,9 @@ export %{rust_env} %{rustlibdir}/%{rust_triple}/analysis/ %changelog +* Wed 23 Jun 2021 sunguoshuai - 1.51.0-2 +- clippy-driver usage should user friendly + * Fri May 07 2021 wangyue - 1.51.0-1 - Update to 1.51.0 -- Gitee From cdff931cffa2f8b85603812cd4094ceb01bb0812 Mon Sep 17 00:00:00 2001 From: si-gui Date: Thu, 24 Jun 2021 17:03:42 +0800 Subject: [PATCH 2/2] cargo help clippy should have description to user (cherry picked from commit 31706e17ecc92c84364d2f6501a93960cc26376b) --- ...ippy-should-have-description-to-user.patch | 30 +++++++++++++++++++ rust.spec | 7 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 cargo-help-clippy-should-have-description-to-user.patch diff --git a/cargo-help-clippy-should-have-description-to-user.patch b/cargo-help-clippy-should-have-description-to-user.patch new file mode 100644 index 0000000..d10579c --- /dev/null +++ b/cargo-help-clippy-should-have-description-to-user.patch @@ -0,0 +1,30 @@ +From 4a2c2e81316960ffbcc3dc1c91758420d6db0a6e Mon Sep 17 00:00:00 2001 +From: si-gui +Date: Thu, 24 Jun 2021 16:35:12 +0800 +Subject: [PATCH] cargo help clippy should have description to user + +--- + src/tools/cargo/src/bin/cargo/cli.rs | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/tools/cargo/src/bin/cargo/cli.rs b/src/tools/cargo/src/bin/cargo/cli.rs +index 243f6ac0..c2dd8785 100644 +--- a/src/tools/cargo/src/bin/cargo/cli.rs ++++ b/src/tools/cargo/src/bin/cargo/cli.rs +@@ -92,7 +92,12 @@ Run with 'cargo -Z [FLAG] [SUBCOMMAND]'" + if is_verbose { + drop_println!(config, " {:<20} {}", name, path.display()); + } else { +- drop_println!(config, " {}", name); ++ if name.as_str() == "clippy" { ++ let summary = "Checks a package to catch common mistakes and improve your Rust code."; ++ drop_println!(config, " {}", name, summary); ++ } else { ++ drop_println!(config, " {}", name); ++ } + } + } + } +-- +2.30.0 + diff --git a/rust.spec b/rust.spec index eabc677..eec3560 100644 --- a/rust.spec +++ b/rust.spec @@ -12,7 +12,7 @@ %bcond_without lldb Name: rust Version: 1.51.0 -Release: 2 +Release: 3 Summary: The Rust Programming Language License: (ASL 2.0 or MIT) and (BSD and MIT) URL: https://www.rust-lang.org @@ -36,6 +36,7 @@ Patch0007: rustc-1.51.0-backport-pr83629.patch Patch0008: rustc-1.48.0-disable-libssh2.patch Patch0009: rustc-1.51.0-disable-http2.patch Patch0010: clippy-driver-usage-should-user-friendly.patch +Patch0011: cargo-help-clippy-should-have-description-to-user.patch %{lua: function rust_triple(arch) local abi = "gnu" if arch == "armv7hl" then @@ -256,6 +257,7 @@ rm -rf src/llvm-project/ mkdir -p src/llvm-project/libunwind/ %endif %patch0010 -p1 +%patch0011 -p1 rm -rf vendor/curl-sys/curl/ rm -rf vendor/jemalloc-sys/jemalloc/ rm -rf vendor/libssh2-sys/libssh2/ @@ -463,6 +465,9 @@ export %{rust_env} %{rustlibdir}/%{rust_triple}/analysis/ %changelog +* Thu 24 Jun 2021 sunguoshuai - 1.51.0-3 +- cargo help clippy should have description to user + * Wed 23 Jun 2021 sunguoshuai - 1.51.0-2 - clippy-driver usage should user friendly -- Gitee