diff --git a/u/uutils-coreutils/manifest.x86_64.bin b/u/uutils-coreutils/manifest.x86_64.bin index 5723ebfa60..b02e782bd3 100644 Binary files a/u/uutils-coreutils/manifest.x86_64.bin and b/u/uutils-coreutils/manifest.x86_64.bin differ diff --git a/u/uutils-coreutils/manifest.x86_64.jsonc b/u/uutils-coreutils/manifest.x86_64.jsonc index 8a3595b92c..7f1695fdf1 100644 --- a/u/uutils-coreutils/manifest.x86_64.jsonc +++ b/u/uutils-coreutils/manifest.x86_64.jsonc @@ -657,6 +657,6 @@ } }, "source-name": "uutils-coreutils", - "source-release": "33", - "source-version": "0.6.0" + "source-release": "34", + "source-version": "0.8.0" } diff --git a/u/uutils-coreutils/pkg/11686.patch b/u/uutils-coreutils/pkg/11686.patch new file mode 100644 index 0000000000..eae32a8d8f --- /dev/null +++ b/u/uutils-coreutils/pkg/11686.patch @@ -0,0 +1,66 @@ +From ca6d35cc5f4a3e0508d2786cafb67146b5669475 Mon Sep 17 00:00:00 2001 +From: oech3 <79379754+oech3@users.noreply.github.com> +Date: Tue, 7 Apr 2026 04:54:34 +0900 +Subject: [PATCH] tee: fix input with sleep + +--- + src/uu/tee/src/tee.rs | 34 +++++++++++++++++++--------------- + 1 file changed, 19 insertions(+), 15 deletions(-) + +diff --git a/src/uu/tee/src/tee.rs b/src/uu/tee/src/tee.rs +index 272083b5c41..9bb4cbd8e05 100644 +--- a/src/uu/tee/src/tee.rs ++++ b/src/uu/tee/src/tee.rs +@@ -118,33 +118,37 @@ fn copy(mut input: impl Read, mut output: impl Write) -> Result { + // the standard library: + // https://github.com/rust-lang/rust/blob/2feb91181882e525e698c4543063f4d0296fcf91/library/std/src/io/copy.rs#L271-L297 + +- // Use small buffer size from std implementation for small input ++ // Use buffer size from std implementation + // https://github.com/rust-lang/rust/blob/2feb91181882e525e698c4543063f4d0296fcf91/library/std/src/sys/io/mod.rs#L44 +- const FIRST_BUF_SIZE: usize = if cfg!(target_os = "espidf") { ++ const BUF_SIZE: usize = if cfg!(target_os = "espidf") { + 512 + } else { + 8 * 1024 + }; +- let mut buffer = [0u8; FIRST_BUF_SIZE]; ++ let mut buffer = [0u8; BUF_SIZE]; + let mut len = 0; +- match input.read(&mut buffer) { +- Ok(0) => return Ok(0), +- Ok(bytes_count) => { +- output.write_all(&buffer[0..bytes_count])?; +- len = bytes_count; +- if bytes_count < FIRST_BUF_SIZE { ++ ++ loop { ++ match input.read(&mut buffer) { ++ Ok(0) => return Ok(len), // end of file ++ Ok(received) => { ++ output.write_all(&buffer[..received])?; + // flush the buffer to comply with POSIX requirement that + // `tee` does not buffer the input. + output.flush()?; +- return Ok(len); ++ len += received; ++ if len > 2 * BUF_SIZE { ++ // buffer is too small ++ break; ++ } + } ++ Err(e) if e.kind() == ErrorKind::Interrupted => {} ++ Err(e) => return Err(e), + } +- Err(e) if e.kind() == ErrorKind::Interrupted => (), +- Err(e) => return Err(e), + } +- +- // but optimize buffer size also for large file +- let mut buffer = vec![0u8; 4 * FIRST_BUF_SIZE]; //stack array makes code path for smaller file slower ++ // optimize for large input ++ //stack array makes code path for smaller file slower ++ let mut buffer = vec![0u8; 4 * BUF_SIZE]; + loop { + match input.read(&mut buffer) { + Ok(0) => return Ok(len), // end of file diff --git a/u/uutils-coreutils/stone.yaml b/u/uutils-coreutils/stone.yaml index 49d6eefb10..6b4672e848 100644 --- a/u/uutils-coreutils/stone.yaml +++ b/u/uutils-coreutils/stone.yaml @@ -2,11 +2,11 @@ # SPDX-License-Identifier: MPL-2.0 name : uutils-coreutils -version : "0.6.0" -release : 33 +version : "0.8.0" +release : 34 homepage : https://uutils.github.io/coreutils/ upstreams : - - https://github.com/uutils/coreutils/archive/refs/tags/0.6.0.tar.gz : f751b8209ec05ae304941a727e42a668dcc45674986252f44d195ed43ccfad2f + - https://github.com/uutils/coreutils/archive/refs/tags/0.8.0.tar.gz : 03f765fd23e9cc66f8789edc6928644d8eae5e5a7962d83795739d0a8a85eaef summary : Cross-platform Rust rewrite of the GNU coreutils description : | Cross-platform Rust rewrite of the GNU coreutils @@ -22,6 +22,7 @@ environment : | export UUTILS_FEATURES="feat_acl,feat_systemd_logind,unix,uudoc" export RUSTFLAGS="$RUSTFLAGS -C codegen-units=1" setup : | + %patch %(pkgdir)/11686.patch %cargo_fetch build : | %cargo_build --features $UUTILS_FEATURES