diff --git a/.gitignore b/.gitignore index 3cade72..14279b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /below-dump-0.4.1.crate /below-dump-0.5.0.crate /below-dump-0.6.3.crate +/below-dump-0.7.1.crate diff --git a/below-dump-clap4.diff b/below-dump-clap4.diff new file mode 100644 index 0000000..bd32f16 --- /dev/null +++ b/below-dump-clap4.diff @@ -0,0 +1,89 @@ +From a1b257d91677637063c1eb359097d53078f7272a Mon Sep 17 00:00:00 2001 +From: Michel Salim +Date: Wed, 2 Aug 2023 12:19:57 -0700 +Subject: [PATCH] migrate to Clap 4 + +Summary: +Two `below` crates currently still use Clap 3; update to 4. + +This unblocks updating below in Fedora which has dropped clap 3 from its repos. + +Reviewed By: brianc118 + +Differential Revision: D48002223 + +fbshipit-source-id: 5f4d02fced4f182098b3ee7627b0af3179d9addb +--- + below/Cargo.toml | 4 ++-- + below/dump/Cargo.toml | 2 +- + below/dump/src/command.rs | 14 +++++++------- + below/src/main.rs | 8 ++++---- + 4 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/below/dump/src/command.rs b/below/dump/src/command.rs +index 50aa60a0..aca370ec 100644 +--- a/src/command.rs ++++ b/src/command.rs +@@ -1045,7 +1045,7 @@ pub enum DumpCommand { + #[clap(about = SYSTEM_ABOUT, long_about = SYSTEM_LONG_ABOUT.as_str())] + System { + /// Select which fields to display and in what order. +- #[clap(short, long, multiple_values = true)] ++ #[clap(short, long, num_args = 1..)] + fields: Option>, + #[clap(flatten)] + opts: GeneralOpt, +@@ -1056,7 +1056,7 @@ pub enum DumpCommand { + #[clap(about = DISK_ABOUT, long_about = DISK_LONG_ABOUT.as_str())] + Disk { + /// Select which fields to display and in what order. +- #[clap(short, long, multiple_values = true)] ++ #[clap(short, long, num_args = 1..)] + fields: Option>, + #[clap(flatten)] + opts: GeneralOpt, +@@ -1084,7 +1084,7 @@ pub enum DumpCommand { + #[clap(about = PROCESS_ABOUT, long_about = PROCESS_LONG_ABOUT.as_str())] + Process { + /// Select which fields to display and in what order. +- #[clap(short, long, multiple_values = true)] ++ #[clap(short, long, num_args = 1..)] + fields: Option>, + #[clap(flatten)] + opts: GeneralOpt, +@@ -1098,7 +1098,7 @@ pub enum DumpCommand { + #[clap(about = CGROUP_ABOUT, long_about = CGROUP_LONG_ABOUT.as_str())] + Cgroup { + /// Select which fields to display and in what order. +- #[clap(short, long, multiple_values = true)] ++ #[clap(short, long, num_args = 1..)] + fields: Option>, + #[clap(flatten)] + opts: GeneralOpt, +@@ -1112,7 +1112,7 @@ pub enum DumpCommand { + #[clap(about = IFACE_ABOUT, long_about = IFACE_LONG_ABOUT.as_str())] + Iface { + /// Select which fields to display and in what order. +- #[clap(short, long, multiple_values = true)] ++ #[clap(short, long, num_args = 1..)] + fields: Option>, + #[clap(flatten)] + opts: GeneralOpt, +@@ -1126,7 +1126,7 @@ pub enum DumpCommand { + #[clap(about = NETWORK_ABOUT, long_about = NETWORK_LONG_ABOUT.as_str())] + Network { + /// Select which fields to display and in what order. +- #[clap(short, long, multiple_values = true)] ++ #[clap(short, long, num_args = 1..)] + fields: Option>, + #[clap(flatten)] + opts: GeneralOpt, +@@ -1137,7 +1137,7 @@ pub enum DumpCommand { + #[clap(about = TRANSPORT_ABOUT, long_about = TRANSPORT_LONG_ABOUT.as_str())] + Transport { + /// Select which fields to display and in what order. +- #[clap(short, long, multiple_values = true)] ++ #[clap(short, long, num_args = 1..)] + fields: Option>, + #[clap(flatten)] + opts: GeneralOpt, diff --git a/below-dump-fix-metadata.diff b/below-dump-fix-metadata.diff index 7be647e..c9640cd 100644 --- a/below-dump-fix-metadata.diff +++ b/below-dump-fix-metadata.diff @@ -1,23 +1,16 @@ ---- below-dump-0.6.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ below-dump-0.6.3/Cargo.toml 2023-01-20T04:01:13.518232+00:00 -@@ -51,11 +51,6 @@ +--- below-dump-0.7.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ below-dump-0.7.1/Cargo.toml 2023-08-02T20:57:58.073673+00:00 +@@ -29,11 +29,11 @@ + version = "0.7.1" - [dependencies.regex] - version = "1.5.4" --features = [ -- "std", -- "unicode-perl", --] --default-features = false - - [dependencies.render] - version = "0.6.3" -@@ -80,7 +75,7 @@ - package = "below-store" - - [dependencies.toml] --version = "=0.5.8" -+version = "0.5.8" - - [dev-dependencies.tempdir] - version = "0.3" + [dependencies.clap] +-version = "3.2.25" ++version = "4" + features = [ + "derive", + "env", +- "regex", ++ "string", + "unicode", + "wrap_help", + ] diff --git a/rust-below-dump.spec b/rust-below-dump.spec index 5940d7b..5f882f2 100644 --- a/rust-below-dump.spec +++ b/rust-below-dump.spec @@ -1,11 +1,11 @@ -# Generated by rust2rpm 23 +# Generated by rust2rpm 24 %bcond_without check %global debug_package %{nil} %global crate below-dump Name: rust-below-dump -Version: 0.6.3 +Version: 0.7.1 Release: %autorelease Summary: Dump crate for below @@ -13,9 +13,11 @@ License: Apache-2.0 URL: https://crates.io/crates/below-dump Source: %{crates_source} # Manually created patch for downstream crate metadata changes -# * restore use of regex default features (back out https://github.com/facebookincubator/below/pull/8164) -# * relax toml dependency from =0.5.8 to 0.5.8 +# * bump clap dependency from 3.2.25 to 4 Patch: below-dump-fix-metadata.diff +# Migrate to clap 4 +# based on https://github.com/facebookincubator/below/commit/a1b257d91677637063c1eb359097d53078f7272a +Patch: below-dump-clap4.diff # below-btrfs and below-model are not available ExcludeArch: %{arm32} %{ix86} diff --git a/sources b/sources index ad82767..48197b2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (below-dump-0.6.3.crate) = 33ce1e4bb82480bd84a18cbacd2c30e96d7269f4a6f42c04e0ba190664139447d77f676e614bc3283066b2935be81ec2cccb85c50abb6377624a7b2541eb6fb3 +SHA512 (below-dump-0.7.1.crate) = 3890603982d1215aeabcdd885687973cf061e56185904f0a6419eb1fedb77522163735c7152762ea57533defdc4b1cd2f103c10f46a247d3a91d3333fb899778