Compare commits

..

2 commits

Author SHA1 Message Date
0a6c336bd5
Rebuilt for ctor 1.x (try 2)
Signed-off-by: Michel Lind <salimma@fedoraproject.org>
2026-08-06 13:36:07 +01:00
943de33dec
Rebuilt for ctor 1.x
Signed-off-by: Michel Lind <salimma@fedoraproject.org>
2026-08-06 12:17:20 +01:00
9 changed files with 2185 additions and 1 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
/coreutils-0.0.23.crate
/coreutils-0.0.27.crate
/coreutils-0.7.0.crate

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# rust-coreutils
The rust-coreutils package

33
coreutils-ctor-1_x.diff Normal file
View file

@ -0,0 +1,33 @@
--- a/tests/test_util_name.rs
+++ b/tests/test_util_name.rs
@@ -16,7 +16,7 @@ pub const TESTS_BINARY: &str = env!("CAR
// Set the environment variable for any tests
// Use the ctor attribute to run this function before any tests
-#[ctor::ctor]
+#[ctor::ctor(unsafe)]
fn init() {
// No need for unsafe here
unsafe {
--- a/tests/test_uudoc.rs
+++ b/tests/test_uudoc.rs
@@ -23,7 +23,7 @@ pub const TESTS_BINARY: &str = env!("CAR
// Set the environment variable for any tests
// Use the ctor attribute to run this function before any tests
-#[ctor::ctor]
+#[ctor::ctor(unsafe)]
fn init() {
// No need for unsafe here
unsafe {
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -8,7 +8,7 @@ use std::env;
pub const TESTS_BINARY: &str = env!("CARGO_BIN_EXE_coreutils");
// Use the ctor attribute to run this function before any tests
-#[ctor::ctor]
+#[ctor::ctor(unsafe)]
fn init() {
unsafe {
// Necessary for uutests to be able to find the binary

View file

@ -0,0 +1,20 @@
--- coreutils-0.7.0/Cargo.toml 2006-07-24T01:21:28+00:00
+++ coreutils-0.7.0/Cargo.toml 2026-08-06T11:26:04.426642+00:00
@@ -719,7 +719,7 @@
package = "uu_runcon"
[dependencies.selinux]
-version = "=0.6.0"
+version = "0.6.0"
optional = true
[dependencies.seq]
@@ -930,7 +930,7 @@
version = "0.6.8"
[dev-dependencies.ctor]
-version = "0.6.0"
+version = "1"
[dev-dependencies.filetime]
version = "0.2.23"

View file

@ -1 +0,0 @@
replaced by uutils-coreutils

1957
rust-coreutils.spec Normal file

File diff suppressed because it is too large Load diff

166
rust2rpm.toml Normal file
View file

@ -0,0 +1,166 @@
[package]
summary = "coreutils ~ GNU coreutils reimplementation in Rust"
description = "coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust."
cargo-toml-patch-comments = [
"loosen selinux version bound from =0.6.0 to 0.6.0",
"bump ctor from 0.6 to 1",
]
bin-package-name = "uutils-coreutils"
extra-files = [
"%{_bindir}/uu_*",
"%{_mandir}/man1/*",
"%{bash_completions_dir}/*",
"%{fish_completions_dir}/*",
"%{zsh_completions_dir}/*",
]
[package.bin-renames]
coreutils = "uutils-coreutils"
[[package.extra-patches]]
number = 2
file = "uutests-ctor-1_x.diff"
comments = ["compatibility fixes for ctor 1.x"]
[features]
enable = [
"feat_os_unix",
"feat_acl",
"feat_selinux",
"feat_systemd_logind",
]
[requires]
build = [
"systemd-devel",
]
[scripts]
build.post = ["""\
mkdir -p data/man/man1
mkdir -p data/completions/{bash,fish,zsh}
for utility in $(target/rpm/coreutils --list); do
target/release/uudoc manpage $utility > data/man/man1/uu_${utility}.1
for s in bash zsh; do
target/release/uudoc completion $utility $s > data/completions/$s/uu_${utility}
done
target/release/uudoc completion $utility fish > data/completions/fish/uu_${utility}.fish
done
target/release/uudoc manpage coreutils > data/man/man1/uutils-coreutils.1
for s in bash zsh; do
target/release/uudoc completion coreutils $s > data/completions/$s/uutils-coreutils
done
target/release/uudoc completion coreutils fish > data/completions/fish/uutils-coreutils.fish
"""]
install.post = ["""\
for utility in $(target/rpm/coreutils --list); do
ln -sr %{buildroot}%{_bindir}/uutils-coreutils %{buildroot}%{_bindir}/uu_$utility
done
mkdir -p %{buildroot}%{_mandir}/man1
cp -p data/man/man1/* %{buildroot}%{_mandir}/man1/
mkdir -p %{buildroot}%{bash_completions_dir}
mkdir -p %{buildroot}%{fish_completions_dir}
mkdir -p %{buildroot}%{zsh_completions_dir}
cp -p data/completions/bash/* %{buildroot}%{bash_completions_dir}/
cp -p data/completions/fish/* %{buildroot}%{fish_completions_dir}/
cp -p data/completions/zsh/* %{buildroot}%{zsh_completions_dir}/
# unneeded, and contain compiled fixtures
rm -rf %{buildroot}%{crate_instdir}/tests
# unneeded at runtime
rm %{buildroot}%{_bindir}/uudoc
"""]
[tests]
comments = [
"--test-threads 1: tests fail with permission denied error if run with too many threads (currently not needed)",
"common::util::tests::test_compare_xattrs: operation not supported",
"test_chcon / test_runcon: SELinux not supported in mock",
"test_cp: operation not supported",
"test_df: needs an actual filesystem to test",
"test_du: expected sublink/symlink in output",
"test_ls: need block/char device",
"test_od: s390x failures, see https://github.com/uutils/coreutils/issues/9017#issuecomment-4148721220",
"test_seq: tolerances too tight",
"test_sort: formatting differences with recent unicode-width versions",
"uudoc: missing test fixture",
"various color and localization tests",
]
skip = [
"common::util::tests::test_compare_xattrs",
"test_chcon::",
"test_runcon::",
"test_cp::test_copy_dir_preserve_permissions",
"test_cp::test_copy_dir_preserve_permissions_inaccessible_file",
"test_cp::test_copy_dir_preserve_subdir_permissions",
"test_cp::test_copy_through_dangling_symlink_no_dereference_permissions",
"test_cp::test_cp_current_directory_preserve_attributes",
"test_cp::test_cp_debug_reflink_auto_sparse_always_non_sparse_file_with_long_zero_sequence",
"test_cp::test_cp_parents_2_dirs",
"test_cp::test_cp_parents_with_permissions_copy_dir",
"test_cp::test_cp_parents_with_permissions_copy_file",
"test_cp::test_cp_preserve_xattr",
"test_cp::test_cp_sparse_always_empty",
"test_cp::test_cp_sparse_always_non_empty",
"test_cp::test_preserve_hardlink_attributes_in_directory",
"test_cp::test_preserve_mode",
"test_df::test_exclude_all_types",
"test_df::test_file_column_width_if_filename_contains_unicode_chars",
"test_df::test_nonexistent_file",
"test_df::test_output_file_specific_files",
"test_df::test_output_mp_repeat",
"test_df::test_output_option_without_equals_sign",
"test_df::test_total_label_in_correct_column",
"test_df::test_type_option_with_file",
"test_du::test_du_dereference_args",
"test_du::test_du_no_dereference",
"test_env::test_env_french",
"test_ls::test_device_number",
"test_ls::test_localized_possible_values",
"test_ls::test_ls_allocation_size",
"test_ls::test_ls_inode",
"test_ls::test_ls_long_format",
"test_ls::test_ls_long_formats",
"test_od::test_od_options_after_filename", # fails on s390x
"test_od::test_suppress_duplicates", # fails on s390x
"test_seq::test_count_down_floats",
"test_seq::test_float_precision_increment",
"test_seq::test_inf_width",
"test_seq::test_neg_inf_width",
"test_seq::test_separator_and_terminator_floats",
"test_seq::test_width_decimal_scientific_notation_increment",
"test_seq::test_width_decimal_scientific_notation_trailing_zeros_end",
"test_seq::test_width_decimal_scientific_notation_trailing_zeros_increment",
"test_seq::test_width_floats",
"test_seq::test_width_negative_zero_decimal_notation",
"test_seq::test_width_negative_zero_scientific_notation",
"test_sort::test_argument_suggestion",
"test_sort::test_clap_localization_help_message",
"test_sort::test_clap_localization_invalid_value",
"test_sort::test_clap_localization_unknown_argument",
"test_sort::test_error_colors_disabled",
"test_sort::test_error_colors_enabled",
"test_sort::test_french_translations",
"test_sort::test_help_colors_disabled",
"test_sort::test_help_colors_enabled",
"test_sort::test_keys_closed_range",
"test_sort::test_keys_multiple_ranges",
"test_sort::test_keys_no_field_match",
"test_sort::test_keys_open_ended",
"test_tail::test_follow_name_truncate4", # fails on x86_64
"test_tail::test_retry7",
"test_tail::test_retry9",
"test_error_messages_french_translation",
"test_french_colored_error_messages",
"test_help_messages_french_translation",
"uudoc_check_sums",
"uudoc_check_test",
]

2
series Normal file
View file

@ -0,0 +1,2 @@
coreutils-fix-metadata.diff
coreutils-ctor-1_x.diff

1
sources Normal file
View file

@ -0,0 +1 @@
SHA512 (coreutils-0.7.0.crate) = da73aa7ae600164da31ae1ba84c6ac5a73ca62a492520aa6fc65816557d68452246e9adec66b3902172f4b0851680610479c8b51a2a095bc19ebd1fbf6036993