Skip to content
Open
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
Binary file modified u/uutils-coreutils/manifest.x86_64.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions u/uutils-coreutils/manifest.x86_64.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,6 @@
}
},
"source-name": "uutils-coreutils",
"source-release": "33",
"source-version": "0.6.0"
"source-release": "34",
"source-version": "0.8.0"
}
66 changes: 66 additions & 0 deletions u/uutils-coreutils/pkg/11686.patch
Original file line number Diff line number Diff line change
@@ -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<usize> {
// 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
7 changes: 4 additions & 3 deletions u/uutils-coreutils/stone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading