Skip to content

Commit c23ebeb

Browse files
authored
Merge branch 'main' into noselinuxprogs
2 parents 5879d01 + 363bda0 commit c23ebeb

22 files changed

Lines changed: 307 additions & 99 deletions

File tree

.github/workflows/CICD.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@ jobs:
303303
run: make nextest CARGOFLAGS="--profile ci --hide-progress-bar"
304304
env:
305305
RUST_BACKTRACE: "1"
306-
- name: "`make install COMPLETIONS=n MANPAGES=n`"
306+
- name: "`make install COMPLETIONS=n MANPAGES=n LOCALES=n`"
307307
shell: bash
308308
run: |
309309
set -x
310-
DESTDIR=/tmp/ make PROFILE=release COMPLETIONS=n MANPAGES=n install
310+
DESTDIR=/tmp/ make PROFILE=release COMPLETIONS=n MANPAGES=n LOCALES=n install
311311
# Check that SELinux progs are missing
312312
! test -f /tmp/usr/local/bin/chcon
313313
# Check that the utils are present
@@ -357,20 +357,12 @@ jobs:
357357
test -f /tmp/usr/local/bin/hashsum
358358
# Check that hashsum symlinks are present
359359
test -h /tmp/usr/local/bin/b2sum
360-
test -h /tmp/usr/local/bin/b3sum
361360
test -h /tmp/usr/local/bin/md5sum
362361
test -h /tmp/usr/local/bin/sha1sum
363362
test -h /tmp/usr/local/bin/sha224sum
364363
test -h /tmp/usr/local/bin/sha256sum
365-
test -h /tmp/usr/local/bin/sha3-224sum
366-
test -h /tmp/usr/local/bin/sha3-256sum
367-
test -h /tmp/usr/local/bin/sha3-384sum
368-
test -h /tmp/usr/local/bin/sha3-512sum
369364
test -h /tmp/usr/local/bin/sha384sum
370-
test -h /tmp/usr/local/bin/sha3sum
371365
test -h /tmp/usr/local/bin/sha512sum
372-
test -h /tmp/usr/local/bin/shake128sum
373-
test -h /tmp/usr/local/bin/shake256sum
374366
- name: "`make install MULTICALL=y LN=ln -svf`"
375367
shell: bash
376368
run: |

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- { package: uu_unexpand }
4444
- { package: uu_uniq }
4545
- { package: uu_wc }
46+
- { package: uu_factor }
4647
steps:
4748
- uses: actions/checkout@v5
4849
with:

.github/workflows/code-quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
else
134134
extra="--features ${{ matrix.job.features }}"
135135
fi
136-
case '${{ matrix.job.workspace-tests }}' in
136+
case '${{ matrix.job.workspace }}' in
137137
1|t|true|y|yes)
138138
extra="${extra} --workspace"
139139
;;
@@ -186,7 +186,7 @@ jobs:
186186
cfg_files=($(shopt -s nullglob ; echo {.vscode,.}/{,.}c[sS]pell{.json,.config{.js,.cjs,.json,.yaml,.yml},.yaml,.yml} ;))
187187
cfg_file=${cfg_files[0]}
188188
unset CSPELL_CFG_OPTION ; if [ -n "$cfg_file" ]; then CSPELL_CFG_OPTION="--config $cfg_file" ; fi
189-
S=$(cspell ${CSPELL_CFG_OPTION} --no-summary --no-progress .) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n "s/${PWD//\//\\/}\/(.*):(.*):(.*) - (.*)/::${fault_type} file=\1,line=\2,col=\3::${fault_type^^}: \4 (file:'\1', line:\2)/p" ; fault=true ; true ; }
189+
S=$(cspell ${CSPELL_CFG_OPTION} --no-summary --no-progress .) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n "s/^(.*):([0-9]+):([0-9]+) - Unknown word \(([^)]+)\).*$/::${fault_type} file=\1,line=\2,col=\3::${fault_type^^}: \`cspell\`: Unknown word '\4' (file:'\1', line:\2)/p" ; fault=true ; true ; }
190190
if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi
191191
192192
toml_format:

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

GNUmakefile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,12 @@ SELINUX_PROGS := \
199199

200200
HASHSUM_PROGS := \
201201
b2sum \
202-
b3sum \
203202
md5sum \
204203
sha1sum \
205204
sha224sum \
206205
sha256sum \
207-
sha3-224sum \
208-
sha3-256sum \
209-
sha3-384sum \
210-
sha3-512sum \
211206
sha384sum \
212-
sha3sum \
213-
sha512sum \
214-
shake128sum \
215-
shake256sum
207+
sha512sum
216208

217209
$(info Detected OS = $(OS))
218210

@@ -465,6 +457,7 @@ install-locales:
465457
fi; \
466458
done
467459
else
460+
locales:
468461
install-locales:
469462
endif
470463

build.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,13 @@ pub fn main() {
7979
phf_map.entry(krate, format!("({krate}::uumain, {krate}::uu_app_custom)"));
8080

8181
let map_value = format!("({krate}::uumain, {krate}::uu_app_common)");
82-
let map_value_bits = format!("({krate}::uumain, {krate}::uu_app_bits)");
83-
let map_value_b3sum = format!("({krate}::uumain, {krate}::uu_app_b3sum)");
8482
phf_map.entry("md5sum", map_value.clone());
8583
phf_map.entry("sha1sum", map_value.clone());
8684
phf_map.entry("sha224sum", map_value.clone());
8785
phf_map.entry("sha256sum", map_value.clone());
8886
phf_map.entry("sha384sum", map_value.clone());
8987
phf_map.entry("sha512sum", map_value.clone());
90-
phf_map.entry("sha3sum", map_value_bits.clone());
91-
phf_map.entry("sha3-224sum", map_value.clone());
92-
phf_map.entry("sha3-256sum", map_value.clone());
93-
phf_map.entry("sha3-384sum", map_value.clone());
94-
phf_map.entry("sha3-512sum", map_value.clone());
95-
phf_map.entry("shake128sum", map_value_bits.clone());
96-
phf_map.entry("shake256sum", map_value_bits.clone());
9788
phf_map.entry("b2sum", map_value.clone());
98-
phf_map.entry("b3sum", map_value_b3sum);
9989
}
10090
_ => {
10191
phf_map.entry(krate, map_value.clone());

docs/src/extensions.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ supports computing the checksums with several algorithms. The flags and options
5454
are identical to the `*sum` family of utils (`sha1sum`, `sha256sum`, `b2sum`,
5555
etc.). This utility will be removed in the future and it is advised to use `cksum --untagged` instead.
5656

57-
## `b3sum`
58-
59-
This utility does not exist in GNU coreutils. The behavior is modeled after both
60-
the `b2sum` utility of GNU and the
61-
[`b3sum`](https://github.com/BLAKE3-team/BLAKE3) utility by the BLAKE3 team. It also
62-
supports the `--no-names` option, that does not appear in the GNU utility.
63-
6457
## `more`
6558

6659
We provide a simple implementation of `more`, which is not part of GNU

src/uu/base32/src/base_common.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,16 @@ pub fn get_input(config: &Config) -> UResult<Box<dyn ReadSeek>> {
171171
}
172172
}
173173

174-
/// Determines if the input buffer ends with padding ('=') after trimming trailing whitespace.
174+
/// Determines if the input buffer contains any padding ('=') ignoring trailing whitespace.
175175
fn read_and_has_padding<R: Read>(input: &mut R) -> UResult<(bool, Vec<u8>)> {
176176
let mut buf = Vec::new();
177177
input
178178
.read_to_end(&mut buf)
179179
.map_err(|err| USimpleError::new(1, format_read_error(err.kind())))?;
180180

181-
// Reverse iterator and skip trailing whitespace without extra collections
182-
let has_padding = buf
183-
.iter()
184-
.rfind(|&&byte| !byte.is_ascii_whitespace())
185-
.is_some_and(|&byte| byte == b'=');
181+
// Treat the stream as padded if any '=' exists (GNU coreutils continues decoding
182+
// even when padding bytes are followed by more data).
183+
let has_padding = buf.contains(&b'=');
186184

187185
Ok((has_padding, buf))
188186
}
@@ -665,6 +663,8 @@ mod tests {
665663
("aGVsbG8sIHdvcmxkIQ== \n", true),
666664
("aGVsbG8sIHdvcmxkIQ=", true),
667665
("aGVsbG8sIHdvcmxkIQ= ", true),
666+
("MTIzNA==MTIzNA", true),
667+
("MTIzNA==\nMTIzNA", true),
668668
("aGVsbG8sIHdvcmxkIQ \n", false),
669669
("aGVsbG8sIHdvcmxkIQ", false),
670670
];

src/uu/du/benches/du_bench.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ fn du_all_balanced_tree(
4545
}
4646
*/
4747

48+
/* too much variance
4849
/// Benchmark du -h (human readable) on balanced tree
4950
#[divan::bench(args = [(5, 4, 10)])]
5051
fn du_human_balanced_tree(
@@ -55,6 +56,7 @@ fn du_human_balanced_tree(
5556
fs_tree::create_balanced_tree(temp_dir.path(), depth, dirs_per_level, files_per_dir);
5657
bench_du_with_args(bencher, &temp_dir, &["-h"]);
5758
}
59+
*/
5860

5961
/// Benchmark du on wide directory structures (many files/dirs, shallow)
6062
#[divan::bench(args = [(5000, 500)])]

src/uu/factor/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,13 @@ fluent = { workspace = true }
2929
name = "factor"
3030
path = "src/main.rs"
3131

32+
[dev-dependencies]
33+
divan = { workspace = true }
34+
uucore = { workspace = true, features = ["benchmark"] }
35+
3236
[lib]
3337
path = "src/factor.rs"
38+
39+
[[bench]]
40+
name = "factor_bench"
41+
harness = false

0 commit comments

Comments
 (0)