From db3b66b7dfa9bb3a8672a37126441ce0161e0d90 Mon Sep 17 00:00:00 2001 From: Gil Date: Sat, 18 Jan 2025 17:11:25 -0600 Subject: [PATCH 1/8] Fix: Add missing build dep Signed-off-by: Gil --- anda/system/uutils-coreutils/uutils-coreutils.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/anda/system/uutils-coreutils/uutils-coreutils.spec b/anda/system/uutils-coreutils/uutils-coreutils.spec index fe6f7f9a78..24df4b8ad5 100644 --- a/anda/system/uutils-coreutils/uutils-coreutils.spec +++ b/anda/system/uutils-coreutils/uutils-coreutils.spec @@ -9,6 +9,7 @@ URL: https://github.com/uutils/coreutils Source0: %url/archive/refs/tags/%version.tar.gz Requires: glibc BuildRequires: cargo make gcc-c++ +BuildRequires: rustfmt Conflicts: uutils-coreutils-replace BuildRequires: libselinux-devel BuildRequires: selinux-policy-devel From fb6377a4d7c617d582c9c64bcd5a31cac97a7374 Mon Sep 17 00:00:00 2001 From: Gil Date: Sat, 18 Jan 2025 17:12:16 -0600 Subject: [PATCH 2/8] Change: Move to Extras Signed-off-by: Gil --- anda/system/uutils-coreutils/anda.hcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anda/system/uutils-coreutils/anda.hcl b/anda/system/uutils-coreutils/anda.hcl index 71536c0fc6..af51146e61 100644 --- a/anda/system/uutils-coreutils/anda.hcl +++ b/anda/system/uutils-coreutils/anda.hcl @@ -2,4 +2,7 @@ project pkg { rpm { spec = "uutils-coreutils.spec" } + labels { + subrepo = "extras" + } } From 34f5eaef9522f631fb27e2972da7a54a6d55aa68 Mon Sep 17 00:00:00 2001 From: Gil Date: Sat, 18 Jan 2025 17:13:22 -0600 Subject: [PATCH 3/8] I forgot the release bump AGAIN Signed-off-by: Gil --- anda/system/uutils-coreutils/uutils-coreutils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/system/uutils-coreutils/uutils-coreutils.spec b/anda/system/uutils-coreutils/uutils-coreutils.spec index 24df4b8ad5..38434d607c 100644 --- a/anda/system/uutils-coreutils/uutils-coreutils.spec +++ b/anda/system/uutils-coreutils/uutils-coreutils.spec @@ -2,7 +2,7 @@ Name: uutils-coreutils Version: 0.0.29 -Release: 1%?dist +Release: 2%?dist Summary: Cross-platform Rust rewrite of the GNU coreutils License: MIT URL: https://github.com/uutils/coreutils From c7ae78c271a94823834dac79ed3a247075a2cba7 Mon Sep 17 00:00:00 2001 From: Gil Date: Sat, 18 Jan 2025 18:26:58 -0600 Subject: [PATCH 4/8] Try this Signed-off-by: Gil --- anda/system/uutils-coreutils/uutils-coreutils.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/anda/system/uutils-coreutils/uutils-coreutils.spec b/anda/system/uutils-coreutils/uutils-coreutils.spec index 38434d607c..0198009bbb 100644 --- a/anda/system/uutils-coreutils/uutils-coreutils.spec +++ b/anda/system/uutils-coreutils/uutils-coreutils.spec @@ -10,6 +10,7 @@ Source0: %url/archive/refs/tags/%version.tar.gz Requires: glibc BuildRequires: cargo make gcc-c++ BuildRequires: rustfmt +BuildRequires: oniguruma Conflicts: uutils-coreutils-replace BuildRequires: libselinux-devel BuildRequires: selinux-policy-devel From c6768370c41de9992ba510e19b4080489075cd97 Mon Sep 17 00:00:00 2001 From: Gil Date: Sun, 19 Jan 2025 18:01:33 -0600 Subject: [PATCH 5/8] Fix: Builds now, also ported some patches from Fedora to our version --- .../coreutils-fix-metadata.diff | 40 ++++++ .../coreutils-fix-seq-neg-num-tests.diff | 134 ++++++++++++++++++ .../uutils-coreutils/uutils-coreutils.spec | 9 +- 3 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 anda/system/uutils-coreutils/coreutils-fix-metadata.diff create mode 100644 anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff diff --git a/anda/system/uutils-coreutils/coreutils-fix-metadata.diff b/anda/system/uutils-coreutils/coreutils-fix-metadata.diff new file mode 100644 index 0000000000..2ae3d7b2f0 --- /dev/null +++ b/anda/system/uutils-coreutils/coreutils-fix-metadata.diff @@ -0,0 +1,40 @@ +--- coreutils-*/Cargo.toml ++++ coreutils-*/Cargo.toml +@@ -18,6 +18,7 @@ + categories = ["command-line-utilities"] + rust-version = "1.79.0" + edition = "2021" ++autobins = false + + build = "build.rs" + +@@ -325,7 +326,7 @@ + rand_core = "0.6.4" + rayon = "1.10" + regex = "1.10.4" +-rstest = "0.24.0" ++rstest = ">=0.24" + rust-ini = "0.21.0" + same-file = "1.0.6" + self_cell = "1.0.4" +@@ -514,7 +515,7 @@ + rstest = { workspace = true } + + [target.'cfg(any(target_os = "linux", target_os = "android"))'.dev-dependencies] +-procfs = { version = "0.17", default-features = false } ++procfs = { version = ">=0.16, <0.18", default-features = false } + + [target.'cfg(unix)'.dev-dependencies] + nix = { workspace = true, features = ["process", "signal", "user", "term"] } +@@ -537,11 +538,6 @@ + name = "coreutils" + path = "src/bin/coreutils.rs" +- +-[[bin]] +-name = "uudoc" +-path = "src/bin/uudoc.rs" +-required-features = ["uudoc"] + + # The default release profile. It contains all optimizations, without + # sacrificing debug info. With this profile (like in the standard + # release profile), the debug info and the stack traces will still be available. diff --git a/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff b/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff new file mode 100644 index 0000000000..dbb164e778 --- /dev/null +++ b/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff @@ -0,0 +1,134 @@ +--- a/tests/by-util/test_seq.rs ++++ b/tests/by-util/test_seq.rs +@@ -381,80 +381,80 @@ + #[test] + fn test_width_negative_zero_scientific_notation() { + new_ucmd!() +- .args(&["-w", "-0e0", "1"]) ++ .args(&["-w", "--", "-0e0", "1"]) + .succeeds() + .stdout_only("-0\n01\n"); + new_ucmd!() +- .args(&["-w", "-0e0", "1", "2"]) ++ .args(&["-w", "--", "-0e0", "1", "2"]) + .succeeds() + .stdout_only("-0\n01\n02\n"); + new_ucmd!() +- .args(&["-w", "-0e0", "1", "2.0"]) ++ .args(&["-w", "--", "-0e0", "1", "2.0"]) + .succeeds() + .stdout_only("-0\n01\n02\n"); + + new_ucmd!() +- .args(&["-w", "-0e+1", "1"]) ++ .args(&["-w", "--", "-0e+1", "1"]) + .succeeds() + .stdout_only("-00\n001\n"); + new_ucmd!() +- .args(&["-w", "-0e+1", "1", "2"]) ++ .args(&["-w", "--", "-0e+1", "1", "2"]) + .succeeds() + .stdout_only("-00\n001\n002\n"); + new_ucmd!() +- .args(&["-w", "-0e+1", "1", "2.0"]) ++ .args(&["-w", "--", "-0e+1", "1", "2.0"]) + .succeeds() + .stdout_only("-00\n001\n002\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e0", "1"]) ++ .args(&["-w", "--", "-0.000e0", "1"]) + .succeeds() + .stdout_only("-0.000\n01.000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e0", "1", "2"]) ++ .args(&["-w", "--", "-0.000e0", "1", "2"]) + .succeeds() + .stdout_only("-0.000\n01.000\n02.000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e0", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e0", "1", "2.0"]) + .succeeds() + .stdout_only("-0.000\n01.000\n02.000\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1"]) ++ .args(&["-w", "--", "-0.000e-2", "1"]) + .succeeds() + .stdout_only("-0.00000\n01.00000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1", "2"]) ++ .args(&["-w", "--", "-0.000e-2", "1", "2"]) + .succeeds() + .stdout_only("-0.00000\n01.00000\n02.00000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e-2", "1", "2.0"]) + .succeeds() + .stdout_only("-0.00000\n01.00000\n02.00000\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e5", "1"]) ++ .args(&["-w", "--", "-0.000e5", "1"]) + .succeeds() + .stdout_only("-000000\n0000001\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e5", "1"]) ++ .args(&["-w", "--", "-0.000e5", "1"]) + .succeeds() + .stdout_only("-000000\n0000001\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + } +@@ -493,7 +493,7 @@ + #[test] + fn test_width_negative_decimal_notation() { + new_ucmd!() +- .args(&["-w", "-.1", ".1", ".11"]) ++ .args(&["-w", "--", "-.1", ".1", ".11"]) + .succeeds() + .stdout_only("-0.1\n00.0\n00.1\n"); + } +@@ -501,19 +501,19 @@ + #[test] + fn test_width_negative_scientific_notation() { + new_ucmd!() +- .args(&["-w", "-1e-3", "1"]) ++ .args(&["-w", "--", "-1e-3", "1"]) + .succeeds() + .stdout_only("-0.001\n00.999\n"); + new_ucmd!() +- .args(&["-w", "-1.e-3", "1"]) ++ .args(&["-w", "--", "-1.e-3", "1"]) + .succeeds() + .stdout_only("-0.001\n00.999\n"); + new_ucmd!() +- .args(&["-w", "-1.0e-4", "1"]) ++ .args(&["-w", "--", "-1.0e-4", "1"]) + .succeeds() + .stdout_only("-0.00010\n00.99990\n"); + new_ucmd!() +- .args(&["-w", "-.1e2", "10", "100"]) ++ .args(&["-w", "--", "-.1e2", "10", "100"]) + .succeeds() + .stdout_only( + "-010 diff --git a/anda/system/uutils-coreutils/uutils-coreutils.spec b/anda/system/uutils-coreutils/uutils-coreutils.spec index 0198009bbb..c37230bcf7 100644 --- a/anda/system/uutils-coreutils/uutils-coreutils.spec +++ b/anda/system/uutils-coreutils/uutils-coreutils.spec @@ -1,4 +1,6 @@ %global coreutils_ver 9.3 +### Temporary solution, will be fixed on newer Oniguruma releases. +%global build_cflags %{__build_flags_lang_c} %{?_distro_extra_cflags} -std=c18 -std=gnu18 Name: uutils-coreutils Version: 0.0.29 @@ -7,10 +9,13 @@ Summary: Cross-platform Rust rewrite of the GNU coreutils License: MIT URL: https://github.com/uutils/coreutils Source0: %url/archive/refs/tags/%version.tar.gz +Patch0: coreutils-fix-metadata.diff +Patch1: coreutils-fix-seq-neg-num-tests.diff Requires: glibc +BuildRequires: anda-srpm-macros +BuildRequires: cargo-rpm-macros BuildRequires: cargo make gcc-c++ BuildRequires: rustfmt -BuildRequires: oniguruma Conflicts: uutils-coreutils-replace BuildRequires: libselinux-devel BuildRequires: selinux-policy-devel @@ -58,7 +63,7 @@ This package provides a single binary with all commands, and replaces the GNU co %prep -%autosetup -n coreutils-%version +%autosetup -n coreutils-%version -p1 %build export CARGOFLAGS="-vv --verbose" From 3e7e92e4c23592e71e565d7fd12216d9537f6a27 Mon Sep 17 00:00:00 2001 From: Gil Date: Sun, 19 Jan 2025 18:02:27 -0600 Subject: [PATCH 6/8] Update uutils-coreutils.spec Signed-off-by: Gil --- anda/system/uutils-coreutils/uutils-coreutils.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/anda/system/uutils-coreutils/uutils-coreutils.spec b/anda/system/uutils-coreutils/uutils-coreutils.spec index c37230bcf7..c7648856a3 100644 --- a/anda/system/uutils-coreutils/uutils-coreutils.spec +++ b/anda/system/uutils-coreutils/uutils-coreutils.spec @@ -12,8 +12,6 @@ Source0: %url/archive/refs/tags/%version.tar.gz Patch0: coreutils-fix-metadata.diff Patch1: coreutils-fix-seq-neg-num-tests.diff Requires: glibc -BuildRequires: anda-srpm-macros -BuildRequires: cargo-rpm-macros BuildRequires: cargo make gcc-c++ BuildRequires: rustfmt Conflicts: uutils-coreutils-replace From e1ec40c658c673fcc694f48bfc81da0dbf0157ff Mon Sep 17 00:00:00 2001 From: Gil Date: Mon, 27 Jan 2025 05:36:52 -0600 Subject: [PATCH 7/8] Remove package (revert if requested) --- anda/system/uutils-coreutils/.gitignore | 1 - anda/system/uutils-coreutils/anda.hcl | 8 - .../coreutils-fix-metadata.diff | 40 ----- .../coreutils-fix-seq-neg-num-tests.diff | 134 -------------- anda/system/uutils-coreutils/update.rhai | 1 - .../uutils-coreutils/uutils-coreutils.spec | 165 ------------------ 6 files changed, 349 deletions(-) delete mode 100644 anda/system/uutils-coreutils/.gitignore delete mode 100644 anda/system/uutils-coreutils/anda.hcl delete mode 100644 anda/system/uutils-coreutils/coreutils-fix-metadata.diff delete mode 100644 anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff delete mode 100644 anda/system/uutils-coreutils/update.rhai delete mode 100644 anda/system/uutils-coreutils/uutils-coreutils.spec diff --git a/anda/system/uutils-coreutils/.gitignore b/anda/system/uutils-coreutils/.gitignore deleted file mode 100644 index c32b546f7d..0000000000 --- a/anda/system/uutils-coreutils/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.tar.gz \ No newline at end of file diff --git a/anda/system/uutils-coreutils/anda.hcl b/anda/system/uutils-coreutils/anda.hcl deleted file mode 100644 index af51146e61..0000000000 --- a/anda/system/uutils-coreutils/anda.hcl +++ /dev/null @@ -1,8 +0,0 @@ -project pkg { - rpm { - spec = "uutils-coreutils.spec" - } - labels { - subrepo = "extras" - } -} diff --git a/anda/system/uutils-coreutils/coreutils-fix-metadata.diff b/anda/system/uutils-coreutils/coreutils-fix-metadata.diff deleted file mode 100644 index 2ae3d7b2f0..0000000000 --- a/anda/system/uutils-coreutils/coreutils-fix-metadata.diff +++ /dev/null @@ -1,40 +0,0 @@ ---- coreutils-*/Cargo.toml -+++ coreutils-*/Cargo.toml -@@ -18,6 +18,7 @@ - categories = ["command-line-utilities"] - rust-version = "1.79.0" - edition = "2021" -+autobins = false - - build = "build.rs" - -@@ -325,7 +326,7 @@ - rand_core = "0.6.4" - rayon = "1.10" - regex = "1.10.4" --rstest = "0.24.0" -+rstest = ">=0.24" - rust-ini = "0.21.0" - same-file = "1.0.6" - self_cell = "1.0.4" -@@ -514,7 +515,7 @@ - rstest = { workspace = true } - - [target.'cfg(any(target_os = "linux", target_os = "android"))'.dev-dependencies] --procfs = { version = "0.17", default-features = false } -+procfs = { version = ">=0.16, <0.18", default-features = false } - - [target.'cfg(unix)'.dev-dependencies] - nix = { workspace = true, features = ["process", "signal", "user", "term"] } -@@ -537,11 +538,6 @@ - name = "coreutils" - path = "src/bin/coreutils.rs" -- --[[bin]] --name = "uudoc" --path = "src/bin/uudoc.rs" --required-features = ["uudoc"] - - # The default release profile. It contains all optimizations, without - # sacrificing debug info. With this profile (like in the standard - # release profile), the debug info and the stack traces will still be available. diff --git a/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff b/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff deleted file mode 100644 index dbb164e778..0000000000 --- a/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff +++ /dev/null @@ -1,134 +0,0 @@ ---- a/tests/by-util/test_seq.rs -+++ b/tests/by-util/test_seq.rs -@@ -381,80 +381,80 @@ - #[test] - fn test_width_negative_zero_scientific_notation() { - new_ucmd!() -- .args(&["-w", "-0e0", "1"]) -+ .args(&["-w", "--", "-0e0", "1"]) - .succeeds() - .stdout_only("-0\n01\n"); - new_ucmd!() -- .args(&["-w", "-0e0", "1", "2"]) -+ .args(&["-w", "--", "-0e0", "1", "2"]) - .succeeds() - .stdout_only("-0\n01\n02\n"); - new_ucmd!() -- .args(&["-w", "-0e0", "1", "2.0"]) -+ .args(&["-w", "--", "-0e0", "1", "2.0"]) - .succeeds() - .stdout_only("-0\n01\n02\n"); - - new_ucmd!() -- .args(&["-w", "-0e+1", "1"]) -+ .args(&["-w", "--", "-0e+1", "1"]) - .succeeds() - .stdout_only("-00\n001\n"); - new_ucmd!() -- .args(&["-w", "-0e+1", "1", "2"]) -+ .args(&["-w", "--", "-0e+1", "1", "2"]) - .succeeds() - .stdout_only("-00\n001\n002\n"); - new_ucmd!() -- .args(&["-w", "-0e+1", "1", "2.0"]) -+ .args(&["-w", "--", "-0e+1", "1", "2.0"]) - .succeeds() - .stdout_only("-00\n001\n002\n"); - - new_ucmd!() -- .args(&["-w", "-0.000e0", "1"]) -+ .args(&["-w", "--", "-0.000e0", "1"]) - .succeeds() - .stdout_only("-0.000\n01.000\n"); - new_ucmd!() -- .args(&["-w", "-0.000e0", "1", "2"]) -+ .args(&["-w", "--", "-0.000e0", "1", "2"]) - .succeeds() - .stdout_only("-0.000\n01.000\n02.000\n"); - new_ucmd!() -- .args(&["-w", "-0.000e0", "1", "2.0"]) -+ .args(&["-w", "--", "-0.000e0", "1", "2.0"]) - .succeeds() - .stdout_only("-0.000\n01.000\n02.000\n"); - - new_ucmd!() -- .args(&["-w", "-0.000e-2", "1"]) -+ .args(&["-w", "--", "-0.000e-2", "1"]) - .succeeds() - .stdout_only("-0.00000\n01.00000\n"); - new_ucmd!() -- .args(&["-w", "-0.000e-2", "1", "2"]) -+ .args(&["-w", "--", "-0.000e-2", "1", "2"]) - .succeeds() - .stdout_only("-0.00000\n01.00000\n02.00000\n"); - new_ucmd!() -- .args(&["-w", "-0.000e-2", "1", "2.0"]) -+ .args(&["-w", "--", "-0.000e-2", "1", "2.0"]) - .succeeds() - .stdout_only("-0.00000\n01.00000\n02.00000\n"); - - new_ucmd!() -- .args(&["-w", "-0.000e5", "1"]) -+ .args(&["-w", "--", "-0.000e5", "1"]) - .succeeds() - .stdout_only("-000000\n0000001\n"); - new_ucmd!() -- .args(&["-w", "-0.000e5", "1", "2"]) -+ .args(&["-w", "--", "-0.000e5", "1", "2"]) - .succeeds() - .stdout_only("-000000\n0000001\n0000002\n"); - new_ucmd!() -- .args(&["-w", "-0.000e5", "1", "2.0"]) -+ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) - .succeeds() - .stdout_only("-000000\n0000001\n0000002\n"); - - new_ucmd!() -- .args(&["-w", "-0.000e5", "1"]) -+ .args(&["-w", "--", "-0.000e5", "1"]) - .succeeds() - .stdout_only("-000000\n0000001\n"); - new_ucmd!() -- .args(&["-w", "-0.000e5", "1", "2"]) -+ .args(&["-w", "--", "-0.000e5", "1", "2"]) - .succeeds() - .stdout_only("-000000\n0000001\n0000002\n"); - new_ucmd!() -- .args(&["-w", "-0.000e5", "1", "2.0"]) -+ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) - .succeeds() - .stdout_only("-000000\n0000001\n0000002\n"); - } -@@ -493,7 +493,7 @@ - #[test] - fn test_width_negative_decimal_notation() { - new_ucmd!() -- .args(&["-w", "-.1", ".1", ".11"]) -+ .args(&["-w", "--", "-.1", ".1", ".11"]) - .succeeds() - .stdout_only("-0.1\n00.0\n00.1\n"); - } -@@ -501,19 +501,19 @@ - #[test] - fn test_width_negative_scientific_notation() { - new_ucmd!() -- .args(&["-w", "-1e-3", "1"]) -+ .args(&["-w", "--", "-1e-3", "1"]) - .succeeds() - .stdout_only("-0.001\n00.999\n"); - new_ucmd!() -- .args(&["-w", "-1.e-3", "1"]) -+ .args(&["-w", "--", "-1.e-3", "1"]) - .succeeds() - .stdout_only("-0.001\n00.999\n"); - new_ucmd!() -- .args(&["-w", "-1.0e-4", "1"]) -+ .args(&["-w", "--", "-1.0e-4", "1"]) - .succeeds() - .stdout_only("-0.00010\n00.99990\n"); - new_ucmd!() -- .args(&["-w", "-.1e2", "10", "100"]) -+ .args(&["-w", "--", "-.1e2", "10", "100"]) - .succeeds() - .stdout_only( - "-010 diff --git a/anda/system/uutils-coreutils/update.rhai b/anda/system/uutils-coreutils/update.rhai deleted file mode 100644 index 69aaaf4ad9..0000000000 --- a/anda/system/uutils-coreutils/update.rhai +++ /dev/null @@ -1 +0,0 @@ -rpm.version(crates("coreutils")); diff --git a/anda/system/uutils-coreutils/uutils-coreutils.spec b/anda/system/uutils-coreutils/uutils-coreutils.spec deleted file mode 100644 index c7648856a3..0000000000 --- a/anda/system/uutils-coreutils/uutils-coreutils.spec +++ /dev/null @@ -1,165 +0,0 @@ -%global coreutils_ver 9.3 -### Temporary solution, will be fixed on newer Oniguruma releases. -%global build_cflags %{__build_flags_lang_c} %{?_distro_extra_cflags} -std=c18 -std=gnu18 - -Name: uutils-coreutils -Version: 0.0.29 -Release: 2%?dist -Summary: Cross-platform Rust rewrite of the GNU coreutils -License: MIT -URL: https://github.com/uutils/coreutils -Source0: %url/archive/refs/tags/%version.tar.gz -Patch0: coreutils-fix-metadata.diff -Patch1: coreutils-fix-seq-neg-num-tests.diff -Requires: glibc -BuildRequires: cargo make gcc-c++ -BuildRequires: rustfmt -Conflicts: uutils-coreutils-replace -BuildRequires: libselinux-devel -BuildRequires: selinux-policy-devel -BuildRequires: clang-devel - -%description -uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. -While all programs have been implemented, some options might be missing or different -behavior might be experienced. - -%package replace -Summary: Cross-platform Rust replacement of the GNU coreutils -Provides: coreutils = %coreutils_ver -Provides: coreutils(%arch) -Provides: coreutils-full - -%description replace -uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. -While all programs have been implemented, some options might be missing or different -behavior might be experienced. - -This package removes the `uu-` prefixes. - -%package util-linux -Summary: uutil-coreutils single binary, with util-linux commands -Requires: uutils-coreutils - -%description util-linux -uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. -While all programs have been implemented, some options might be missing or different -behavior might be experienced. - -This package provides a single binary with commands for util-linux with the `uu-` prefix. - -%package util-linux-replace -Summary: uutils-coreutils single-binary, replaces coreutils and util-linux -Provides: util-linux - -%description util-linux-replace -uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. -While all programs have been implemented, some options might be missing or different -behavior might be experienced. - -This package provides a single binary with all commands, and replaces the GNU coreutils and util-linux commands. - - -%prep -%autosetup -n coreutils-%version -p1 - -%build -export CARGOFLAGS="-vv --verbose" -%make_build PROFILE=release SELINUX_ENABLED=1 - -%install -%make_install PROFILE=release MULTICALL=n DESTDIR=%buildroot PREFIX=%_prefix SELINUX_ENABLED=1 PROG_PREFIX=uu- & -%make_install PROFILE=release MULTICALL=n DESTDIR=%buildroot PREFIX=%_prefix SELINUX_ENABLED=1 & -wait - -# function to remove files from a file list (used below for excludes) - -rm_filelist() { - local filelist=$1 - - for file in $(cat $filelist); do - echo ":: --> $file" - if [ -f "$file" ]; then - rm -vf "$file" - fi - if [ -f "%buildroot/$file" ]; then - rm -vf "%buildroot/$file" - fi - done -} - -%define cmds() $(echo %1{runcon,arch,base{32,64,name,nc},cat,ch{grp,mod,own,root,con},cksum,comm,cp,csplit,cut,date,dd,df,dir{,colors,name},du,echo,env,expand,expr,factor,false,fmt,fold,groups,hashsum,head,host{id},id,install,join,link,ln,logname,ls,mk{dir,fifo,nod,temp},mv,nice,nl,nohup,nproc,numfmt,od,paste,pathchk,pinky,pr,printenv,printf,ptx,pwd,readlink,realpath,rm{,dir},seq,shred,shuf,sleep,sort,split,stat,stdbuf,sum,sync,tac,tail,tee,test,timeout,touch,tr,true,truncate,tsort,tty,uname,un{expand,iq,link},users,vdir,wc,who{,ami},yes}%2) -%define excludes() $(echo %1{hostname,kill,more,uptime}%2) -cat < files.txt -%cmds %_bindir/uu- "" -%_bindir/uu-[ -%cmds %_datadir/bash-completion/completions/uu- "" -%cmds %_datadir/fish/vendor_completions.d/uu- .fish -%cmds %_mandir/man1/uu- .1.gz -%cmds %_datadir/zsh/site-functions/_uu- "" -EOF -sed -i 's@ @\n@g' files.txt - -cat < files-exclude.txt -%excludes %_datadir/bash-completion/completions/uu- "" -%excludes %_datadir/fish/vendor_completions.d/uu- .fish -%excludes %_mandir/man1/uu- .1.gz -%excludes %_datadir/zsh/site-functions/_uu- "" -%excludes %_bindir/uu- "" -EOF - -sed -i 's@ @\n@g' files-exclude.txt - -# remove buildroot from paths in files.txt -sed -i "s@%buildroot@/@g" files.txt - -### files-replace - -cat < files-replace.txt -%cmds %_bindir/ "" -%_bindir/[ -%cmds %_datadir/bash-completion/completions/ "" -%cmds %_datadir/fish/vendor_completions.d/ .fish -%cmds %_mandir/man1/ .1.gz -%cmds %_datadir/zsh/site-functions/_ "" -EOF -sed -i 's@ @\n@g' files-replace.txt - -cat < files-replace-exclude.txt -%excludes %_datadir/bash-completion/completions/ "" -%excludes %_datadir/fish/vendor_completions.d/ .fish -%excludes %_mandir/man1/ .1.gz -%excludes %_datadir/zsh/site-functions/_ "" -%excludes %_bindir/ "" -EOF - -sed -i 's@ @\n@g' files-replace-exclude.txt - -# remove buildroot from paths in files.txt -sed -i "s@%buildroot@/@g" files-replace.txt - - -echo "=== Files ===" -cat files.txt -echo "=== Files (Replace) ===" -cat files-replace.txt - -#echo "=== Removing files ===" - -#rm_filelist files-exclude.txt -#rm_filelist files-replace-exclude.txt - -%files -f files.txt -%doc README.md -%license LICENSE - -%files replace -f files-replace.txt -%doc README.md -%license LICENSE - -%files util-linux -f files-exclude.txt - -%files util-linux-replace -f files-replace-exclude.txt - -%changelog -%autochangelog From d3f81c75a7cfa91c4d20d6c34566062e0ba2be39 Mon Sep 17 00:00:00 2001 From: Gil Date: Wed, 29 Jan 2025 02:23:43 -0600 Subject: [PATCH 8/8] Revert "Remove package (revert if requested)" This reverts commit e1ec40c658c673fcc694f48bfc81da0dbf0157ff. --- anda/system/uutils-coreutils/.gitignore | 1 + anda/system/uutils-coreutils/anda.hcl | 8 + .../coreutils-fix-metadata.diff | 40 +++++ .../coreutils-fix-seq-neg-num-tests.diff | 134 ++++++++++++++ anda/system/uutils-coreutils/update.rhai | 1 + .../uutils-coreutils/uutils-coreutils.spec | 165 ++++++++++++++++++ 6 files changed, 349 insertions(+) create mode 100644 anda/system/uutils-coreutils/.gitignore create mode 100644 anda/system/uutils-coreutils/anda.hcl create mode 100644 anda/system/uutils-coreutils/coreutils-fix-metadata.diff create mode 100644 anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff create mode 100644 anda/system/uutils-coreutils/update.rhai create mode 100644 anda/system/uutils-coreutils/uutils-coreutils.spec diff --git a/anda/system/uutils-coreutils/.gitignore b/anda/system/uutils-coreutils/.gitignore new file mode 100644 index 0000000000..c32b546f7d --- /dev/null +++ b/anda/system/uutils-coreutils/.gitignore @@ -0,0 +1 @@ +*.tar.gz \ No newline at end of file diff --git a/anda/system/uutils-coreutils/anda.hcl b/anda/system/uutils-coreutils/anda.hcl new file mode 100644 index 0000000000..af51146e61 --- /dev/null +++ b/anda/system/uutils-coreutils/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "uutils-coreutils.spec" + } + labels { + subrepo = "extras" + } +} diff --git a/anda/system/uutils-coreutils/coreutils-fix-metadata.diff b/anda/system/uutils-coreutils/coreutils-fix-metadata.diff new file mode 100644 index 0000000000..2ae3d7b2f0 --- /dev/null +++ b/anda/system/uutils-coreutils/coreutils-fix-metadata.diff @@ -0,0 +1,40 @@ +--- coreutils-*/Cargo.toml ++++ coreutils-*/Cargo.toml +@@ -18,6 +18,7 @@ + categories = ["command-line-utilities"] + rust-version = "1.79.0" + edition = "2021" ++autobins = false + + build = "build.rs" + +@@ -325,7 +326,7 @@ + rand_core = "0.6.4" + rayon = "1.10" + regex = "1.10.4" +-rstest = "0.24.0" ++rstest = ">=0.24" + rust-ini = "0.21.0" + same-file = "1.0.6" + self_cell = "1.0.4" +@@ -514,7 +515,7 @@ + rstest = { workspace = true } + + [target.'cfg(any(target_os = "linux", target_os = "android"))'.dev-dependencies] +-procfs = { version = "0.17", default-features = false } ++procfs = { version = ">=0.16, <0.18", default-features = false } + + [target.'cfg(unix)'.dev-dependencies] + nix = { workspace = true, features = ["process", "signal", "user", "term"] } +@@ -537,11 +538,6 @@ + name = "coreutils" + path = "src/bin/coreutils.rs" +- +-[[bin]] +-name = "uudoc" +-path = "src/bin/uudoc.rs" +-required-features = ["uudoc"] + + # The default release profile. It contains all optimizations, without + # sacrificing debug info. With this profile (like in the standard + # release profile), the debug info and the stack traces will still be available. diff --git a/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff b/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff new file mode 100644 index 0000000000..dbb164e778 --- /dev/null +++ b/anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff @@ -0,0 +1,134 @@ +--- a/tests/by-util/test_seq.rs ++++ b/tests/by-util/test_seq.rs +@@ -381,80 +381,80 @@ + #[test] + fn test_width_negative_zero_scientific_notation() { + new_ucmd!() +- .args(&["-w", "-0e0", "1"]) ++ .args(&["-w", "--", "-0e0", "1"]) + .succeeds() + .stdout_only("-0\n01\n"); + new_ucmd!() +- .args(&["-w", "-0e0", "1", "2"]) ++ .args(&["-w", "--", "-0e0", "1", "2"]) + .succeeds() + .stdout_only("-0\n01\n02\n"); + new_ucmd!() +- .args(&["-w", "-0e0", "1", "2.0"]) ++ .args(&["-w", "--", "-0e0", "1", "2.0"]) + .succeeds() + .stdout_only("-0\n01\n02\n"); + + new_ucmd!() +- .args(&["-w", "-0e+1", "1"]) ++ .args(&["-w", "--", "-0e+1", "1"]) + .succeeds() + .stdout_only("-00\n001\n"); + new_ucmd!() +- .args(&["-w", "-0e+1", "1", "2"]) ++ .args(&["-w", "--", "-0e+1", "1", "2"]) + .succeeds() + .stdout_only("-00\n001\n002\n"); + new_ucmd!() +- .args(&["-w", "-0e+1", "1", "2.0"]) ++ .args(&["-w", "--", "-0e+1", "1", "2.0"]) + .succeeds() + .stdout_only("-00\n001\n002\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e0", "1"]) ++ .args(&["-w", "--", "-0.000e0", "1"]) + .succeeds() + .stdout_only("-0.000\n01.000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e0", "1", "2"]) ++ .args(&["-w", "--", "-0.000e0", "1", "2"]) + .succeeds() + .stdout_only("-0.000\n01.000\n02.000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e0", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e0", "1", "2.0"]) + .succeeds() + .stdout_only("-0.000\n01.000\n02.000\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1"]) ++ .args(&["-w", "--", "-0.000e-2", "1"]) + .succeeds() + .stdout_only("-0.00000\n01.00000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1", "2"]) ++ .args(&["-w", "--", "-0.000e-2", "1", "2"]) + .succeeds() + .stdout_only("-0.00000\n01.00000\n02.00000\n"); + new_ucmd!() +- .args(&["-w", "-0.000e-2", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e-2", "1", "2.0"]) + .succeeds() + .stdout_only("-0.00000\n01.00000\n02.00000\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e5", "1"]) ++ .args(&["-w", "--", "-0.000e5", "1"]) + .succeeds() + .stdout_only("-000000\n0000001\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + + new_ucmd!() +- .args(&["-w", "-0.000e5", "1"]) ++ .args(&["-w", "--", "-0.000e5", "1"]) + .succeeds() + .stdout_only("-000000\n0000001\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + new_ucmd!() +- .args(&["-w", "-0.000e5", "1", "2.0"]) ++ .args(&["-w", "--", "-0.000e5", "1", "2.0"]) + .succeeds() + .stdout_only("-000000\n0000001\n0000002\n"); + } +@@ -493,7 +493,7 @@ + #[test] + fn test_width_negative_decimal_notation() { + new_ucmd!() +- .args(&["-w", "-.1", ".1", ".11"]) ++ .args(&["-w", "--", "-.1", ".1", ".11"]) + .succeeds() + .stdout_only("-0.1\n00.0\n00.1\n"); + } +@@ -501,19 +501,19 @@ + #[test] + fn test_width_negative_scientific_notation() { + new_ucmd!() +- .args(&["-w", "-1e-3", "1"]) ++ .args(&["-w", "--", "-1e-3", "1"]) + .succeeds() + .stdout_only("-0.001\n00.999\n"); + new_ucmd!() +- .args(&["-w", "-1.e-3", "1"]) ++ .args(&["-w", "--", "-1.e-3", "1"]) + .succeeds() + .stdout_only("-0.001\n00.999\n"); + new_ucmd!() +- .args(&["-w", "-1.0e-4", "1"]) ++ .args(&["-w", "--", "-1.0e-4", "1"]) + .succeeds() + .stdout_only("-0.00010\n00.99990\n"); + new_ucmd!() +- .args(&["-w", "-.1e2", "10", "100"]) ++ .args(&["-w", "--", "-.1e2", "10", "100"]) + .succeeds() + .stdout_only( + "-010 diff --git a/anda/system/uutils-coreutils/update.rhai b/anda/system/uutils-coreutils/update.rhai new file mode 100644 index 0000000000..69aaaf4ad9 --- /dev/null +++ b/anda/system/uutils-coreutils/update.rhai @@ -0,0 +1 @@ +rpm.version(crates("coreutils")); diff --git a/anda/system/uutils-coreutils/uutils-coreutils.spec b/anda/system/uutils-coreutils/uutils-coreutils.spec new file mode 100644 index 0000000000..c7648856a3 --- /dev/null +++ b/anda/system/uutils-coreutils/uutils-coreutils.spec @@ -0,0 +1,165 @@ +%global coreutils_ver 9.3 +### Temporary solution, will be fixed on newer Oniguruma releases. +%global build_cflags %{__build_flags_lang_c} %{?_distro_extra_cflags} -std=c18 -std=gnu18 + +Name: uutils-coreutils +Version: 0.0.29 +Release: 2%?dist +Summary: Cross-platform Rust rewrite of the GNU coreutils +License: MIT +URL: https://github.com/uutils/coreutils +Source0: %url/archive/refs/tags/%version.tar.gz +Patch0: coreutils-fix-metadata.diff +Patch1: coreutils-fix-seq-neg-num-tests.diff +Requires: glibc +BuildRequires: cargo make gcc-c++ +BuildRequires: rustfmt +Conflicts: uutils-coreutils-replace +BuildRequires: libselinux-devel +BuildRequires: selinux-policy-devel +BuildRequires: clang-devel + +%description +uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. +While all programs have been implemented, some options might be missing or different +behavior might be experienced. + +%package replace +Summary: Cross-platform Rust replacement of the GNU coreutils +Provides: coreutils = %coreutils_ver +Provides: coreutils(%arch) +Provides: coreutils-full + +%description replace +uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. +While all programs have been implemented, some options might be missing or different +behavior might be experienced. + +This package removes the `uu-` prefixes. + +%package util-linux +Summary: uutil-coreutils single binary, with util-linux commands +Requires: uutils-coreutils + +%description util-linux +uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. +While all programs have been implemented, some options might be missing or different +behavior might be experienced. + +This package provides a single binary with commands for util-linux with the `uu-` prefix. + +%package util-linux-replace +Summary: uutils-coreutils single-binary, replaces coreutils and util-linux +Provides: util-linux + +%description util-linux-replace +uutils coreutils is a cross-platform reimplementation of the GNU coreutils in Rust. +While all programs have been implemented, some options might be missing or different +behavior might be experienced. + +This package provides a single binary with all commands, and replaces the GNU coreutils and util-linux commands. + + +%prep +%autosetup -n coreutils-%version -p1 + +%build +export CARGOFLAGS="-vv --verbose" +%make_build PROFILE=release SELINUX_ENABLED=1 + +%install +%make_install PROFILE=release MULTICALL=n DESTDIR=%buildroot PREFIX=%_prefix SELINUX_ENABLED=1 PROG_PREFIX=uu- & +%make_install PROFILE=release MULTICALL=n DESTDIR=%buildroot PREFIX=%_prefix SELINUX_ENABLED=1 & +wait + +# function to remove files from a file list (used below for excludes) + +rm_filelist() { + local filelist=$1 + + for file in $(cat $filelist); do + echo ":: --> $file" + if [ -f "$file" ]; then + rm -vf "$file" + fi + if [ -f "%buildroot/$file" ]; then + rm -vf "%buildroot/$file" + fi + done +} + +%define cmds() $(echo %1{runcon,arch,base{32,64,name,nc},cat,ch{grp,mod,own,root,con},cksum,comm,cp,csplit,cut,date,dd,df,dir{,colors,name},du,echo,env,expand,expr,factor,false,fmt,fold,groups,hashsum,head,host{id},id,install,join,link,ln,logname,ls,mk{dir,fifo,nod,temp},mv,nice,nl,nohup,nproc,numfmt,od,paste,pathchk,pinky,pr,printenv,printf,ptx,pwd,readlink,realpath,rm{,dir},seq,shred,shuf,sleep,sort,split,stat,stdbuf,sum,sync,tac,tail,tee,test,timeout,touch,tr,true,truncate,tsort,tty,uname,un{expand,iq,link},users,vdir,wc,who{,ami},yes}%2) +%define excludes() $(echo %1{hostname,kill,more,uptime}%2) +cat < files.txt +%cmds %_bindir/uu- "" +%_bindir/uu-[ +%cmds %_datadir/bash-completion/completions/uu- "" +%cmds %_datadir/fish/vendor_completions.d/uu- .fish +%cmds %_mandir/man1/uu- .1.gz +%cmds %_datadir/zsh/site-functions/_uu- "" +EOF +sed -i 's@ @\n@g' files.txt + +cat < files-exclude.txt +%excludes %_datadir/bash-completion/completions/uu- "" +%excludes %_datadir/fish/vendor_completions.d/uu- .fish +%excludes %_mandir/man1/uu- .1.gz +%excludes %_datadir/zsh/site-functions/_uu- "" +%excludes %_bindir/uu- "" +EOF + +sed -i 's@ @\n@g' files-exclude.txt + +# remove buildroot from paths in files.txt +sed -i "s@%buildroot@/@g" files.txt + +### files-replace + +cat < files-replace.txt +%cmds %_bindir/ "" +%_bindir/[ +%cmds %_datadir/bash-completion/completions/ "" +%cmds %_datadir/fish/vendor_completions.d/ .fish +%cmds %_mandir/man1/ .1.gz +%cmds %_datadir/zsh/site-functions/_ "" +EOF +sed -i 's@ @\n@g' files-replace.txt + +cat < files-replace-exclude.txt +%excludes %_datadir/bash-completion/completions/ "" +%excludes %_datadir/fish/vendor_completions.d/ .fish +%excludes %_mandir/man1/ .1.gz +%excludes %_datadir/zsh/site-functions/_ "" +%excludes %_bindir/ "" +EOF + +sed -i 's@ @\n@g' files-replace-exclude.txt + +# remove buildroot from paths in files.txt +sed -i "s@%buildroot@/@g" files-replace.txt + + +echo "=== Files ===" +cat files.txt +echo "=== Files (Replace) ===" +cat files-replace.txt + +#echo "=== Removing files ===" + +#rm_filelist files-exclude.txt +#rm_filelist files-replace-exclude.txt + +%files -f files.txt +%doc README.md +%license LICENSE + +%files replace -f files-replace.txt +%doc README.md +%license LICENSE + +%files util-linux -f files-exclude.txt + +%files util-linux-replace -f files-replace-exclude.txt + +%changelog +%autochangelog