Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Replace uutils-coreutils with uutils-replace packages #3056

Draft
wants to merge 9 commits into
base: frawhide
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions anda/system/uutils-coreutils/anda.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ project pkg {
rpm {
spec = "uutils-coreutils.spec"
}
labels {
subrepo = "extras"
}
}
40 changes: 40 additions & 0 deletions anda/system/uutils-coreutils/coreutils-fix-metadata.diff
Original file line number Diff line number Diff line change
@@ -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.
134 changes: 134 additions & 0 deletions anda/system/uutils-coreutils/coreutils-fix-seq-neg-num-tests.diff
Original file line number Diff line number Diff line change
@@ -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
9 changes: 7 additions & 2 deletions anda/system/uutils-coreutils/uutils-coreutils.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
%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: 1%?dist
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
Expand Down Expand Up @@ -56,7 +61,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"
Expand Down