Skip to content
Snippets Groups Projects
Commit 06b6b564 authored by Apertis package maintainers's avatar Apertis package maintainers
Browse files

d/patches: backport improvements to the `sort` command


The post-installation script of at least one packages makes use of the
`-k` option for `sort`, which isn't implemented in release 0.0.6 of
`rust-coreutils`.

As this has since been implemented upstream, this commit picks the
corresponding patches so we can benefit of those improvements.

Signed-off-by: default avatarArnaud Ferraris <arnaud.ferraris@collabora.com>
parent 84e78abb
No related branches found
No related tags found
No related merge requests found
From: Sylvestre Ledru <sylvestre@debian.org>
Date: Fri, 9 Apr 2021 10:14:41 +0200
Subject: Ignore a test (#2053)
* Disable chksum: test_arg_overrides_stdin
fails often with:
---- test_cksum::test_arg_overrides_stdin stdout ----
current_directory_resolved:
touch: /tmp/.tmpv9hydc/a
run: /target/x86_64-unknown-linux-gnu/debug/coreutils cksum a
thread 'test_cksum::test_arg_overrides_stdin' panicked at 'Broken pipe (os error 32)', tests/common/util.rs:742:37
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
* rustfmt the recent change
Origin: upstream, https://github.com/uutils/coreutils/commit/9ae4928b7b4f43495921fe8ac6128ea226d20dbd
---
src/uu/sort/src/sort.rs | 6 ++----
src/uu/stdbuf/src/stdbuf.rs | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/uu/sort/src/sort.rs b/src/uu/sort/src/sort.rs
index 08936ff..cf6c258 100644
--- a/src/uu/sort/src/sort.rs
+++ b/src/uu/sort/src/sort.rs
@@ -665,9 +665,7 @@ fn get_leading_gen(a: &str) -> String {
for c in p_iter.to_owned() {
let next_char_numeric = p_iter.peek().unwrap_or(&'\0').is_numeric();
// Only general numeric recognizes e notation and, see block below, the '+' sign
- if (c.eq(&'e') && !next_char_numeric)
- || (c.eq(&'E') && !next_char_numeric)
- {
+ if (c.eq(&'e') && !next_char_numeric) || (c.eq(&'E') && !next_char_numeric) {
r = a.split(c).next().unwrap_or("").to_owned();
break;
// If positive sign and next char is not numeric, split at postive sign at keep trailing numbers
@@ -813,7 +811,7 @@ fn human_numeric_convert(a: &str) -> f64 {
'E' => 1E18,
'Z' => 1E21,
'Y' => 1E24,
- _ => 1f64,
+ _ => 1f64,
};
num_part * suffix
}
diff --git a/src/uu/stdbuf/src/stdbuf.rs b/src/uu/stdbuf/src/stdbuf.rs
index a61ba96..67ed9a8 100644
--- a/src/uu/stdbuf/src/stdbuf.rs
+++ b/src/uu/stdbuf/src/stdbuf.rs
@@ -80,8 +80,7 @@ fn print_version() {
fn print_usage(opts: &Options) {
let brief = "Run COMMAND, with modified buffering operations for its standard streams\n \
Mandatory arguments to long options are mandatory for short options too.";
- let explanation =
- "If MODE is 'L' the corresponding stream will be line buffered.\n \
+ let explanation = "If MODE is 'L' the corresponding stream will be line buffered.\n \
This option is invalid with standard input.\n\n \
If MODE is '0' the corresponding stream will be unbuffered.\n\n \
Otherwise MODE is a number which may be followed by one of the following:\n\n \
This diff is collapsed.
This diff is collapsed.
...@@ -10,3 +10,9 @@ revert-file-diff-0.diff ...@@ -10,3 +10,9 @@ revert-file-diff-0.diff
revert-file-diff.diff revert-file-diff.diff
revert-twox-hash.dif revert-twox-hash.dif
revert-retain-mut.diff revert-retain-mut.diff
# Backported from upstream
Sort-Implement-stable-sort-ignore-non-printing-month.patch
Ignore-a-test.patch
Sort-Various-fixes-and-performance-improvements.patch
sort-implement-k-and-t-support.patch
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment