Commit graph

1560 commits

Author SHA1 Message Date
Niyaz Nigmatullin
5f3f1112d1
Basename arguments simple format (#3736)
* basename: support simple format

* tests/basename: add tests for simple format

* basename: follow clippy advice
2022-07-22 13:28:54 +02:00
Daniel Hofstetter
29c4d08ee9 numfmt: enable ignored test 2022-07-21 13:20:42 +02:00
Sylvestre Ledru
ba24565b60
Merge pull request #3732 from cakebaker/numfmt_auto_suf_si_i
numfmt: show "invalid suffix" error for "i" suffix
2022-07-20 22:51:14 +02:00
Daniel Hofstetter
74bd9a26d6 numfmt: show "invalid suffix" error for "i" suffix 2022-07-20 17:51:36 +02:00
Niyaz Nigmatullin
406d3931e9 tests/ln: fix tests according to new messages 2022-07-19 17:34:52 +03:00
Owen Anderson
735db78b3d
wc: specialize scanning loop on settings. (#3708)
* wc: specialize scanning loop on settings.

The primary computational loop in wc (iterating over all the
characters and computing word lengths, etc) is configured by a
number of boolean options that control the text-scanning behavior.
If we monomorphize the code loop for each possible combination of
scanning configurations, the rustc is able to generate better code
for each instantiation, at the least by removing the conditional
checks on each iteration, and possibly by allowing things like
vectorization.

On my computer (aarch64/macos), I am seeing at least a 5% performance
improvement in release builds on all wc flag configurations
(other than those that were already specialized) against
odyssey1024.txt, with wc -l showing the greatest improvement at 15%.

* Reduce the size of the wc dispatch table by half.

By extracting the handling of hand-written fast-paths to the
same dispatch as the automatic specializations, we can avoid
needing to pass `show_bytes` as a const generic to
`word_count_from_reader_specialized`. Eliminating this parameter
halves the number of arms in the dispatch.
2022-07-18 12:16:52 +02:00
Sylvestre Ledru
189a8af450
Merge pull request #3721 from niyaznigmatullin/add_test_for_issue_3332
tests/cp: add test for cp-parents.sh
2022-07-18 12:11:30 +02:00
Niyaz Nigmatullin
0ab0f2761f tests/ln: add test for same file 2022-07-18 08:17:37 +03:00
Niyaz Nigmatullin
028c08cce2 tests/rm: add test for issue #3722 2022-07-17 23:34:04 +03:00
Niyaz Nigmatullin
147f83f68a tests/cp: add test for cp-parents.sh 2022-07-17 23:04:09 +03:00
Niyaz Nigmatullin
0ea3a735ca
readlink: symlink loop handling (#3717)
readlink: fix symlink loop handling
2022-07-14 22:32:55 +02:00
Sylvestre Ledru
882cd527ff
Merge pull request #3704 from Sciencentistguy/once_cell
Replace lazy_static with once_cell
2022-07-13 16:15:47 +02:00
Daniel Hofstetter
9e44acf307 numfmt: reject suffix if unit is "none" 2022-07-13 10:47:59 +02:00
Jamie Quigley
1a270361c0
Replace lazy_static with once_cell 2022-07-12 14:08:30 +01:00
Daniel Hofstetter
aef24db90f numfmt: show error if "i" suffix is missing 2022-07-12 10:58:07 +02:00
Niyaz Nigmatullin
de65d4d649
Realpath relative options (#3710)
* realpath: introduce relative options, make correct exit codes, make pass
GNU test mist/realpath.sh
2022-07-12 08:29:20 +02:00
Sylvestre Ledru
e239ed9417
Merge pull request #3692 from jfinkels/cp-preserve-perm-link
cp: correctly copy attributes of a dangling symbolic link
2022-07-11 22:50:24 +02:00
Sylvestre Ledru
8074020a8b
Merge pull request #3705 from cakebaker/numfmt_unit
numfmt: implement "--to-unit" & "--from-unit"
2022-07-11 22:46:56 +02:00
Niyaz Nigmatullin
da5808d4ac
ls: add already listed message (#3707)
* ls: handle looping symlinks infinite printing

* ls: better coloring and printing symlinks when dereferenced

* tests/ls: add dereferencing and symlink loop tests

* ls: reformat changed using rustfmt

* ls: follow clippy advice for cleaner code

* uucore/fs: fix FileInformation to open directory handles in Windows as
well
2022-07-11 17:18:58 +02:00
Niyaz Nigmatullin
9d285e953d
Realpath symlinks handling, solves issue #3669 (#3703) 2022-07-10 16:49:25 +02:00
Daniel Hofstetter
1f292dd834 numfmt: implement "--to-unit" & "--from-unit" 2022-07-09 08:01:27 +02:00
Sylvestre Ledru
392ae87a9f
Merge pull request #3700 from cakebaker/comm_enable_output_delimiter_test
comm: enable "output_delimiter" test
2022-07-08 18:41:51 +02:00
Ed Smith
5c13e88f8b Do not trap pipe errors in yes
This is part of fixing the tee tests. 'yes' is used by the GNU test
suite to identify what the SIGPIPE exit code is on the target
platform. By trapping SIGPIPE, it creates a requirement that other
utilities also trap SIGPIPE (and exit 0 after SIGPIPE). This is
sometimes at odds with their desired behaviour.
2022-07-07 15:23:50 +02:00
Ed Smith
a360504574 Implement tee -p and --output-error
This has the following behaviours. On Unix:

- The default is to exit on pipe errors, and warn on other errors.

- "--output-error=warn" means to warn on all errors

- "--output-error", "--output-error=warn-nopipe" and "-p" all mean
  that pipe errors are suppressed, all other errors warn.

- "--output-error=exit" means to warn and exit on all errors.

- "--output-error=exit-nopipe" means to suppress pipe errors, and to
  warn and exit on all other errors.

On non-Unix platforms, all pipe behaviours are ignored, so the default
is effectively "--output-error=warn" and "warn-nopipe" is identical.
The only meaningful option is "--output-error=exit" which is identical
to "--output-error=exit-nopipe" on these platforms.

Note that warnings give a non-zero exit code, but do not halt writing
to non-erroring targets.
2022-07-07 15:23:50 +02:00
Sylvestre Ledru
922afa29ff
Merge branch 'main' into cp-preserve-perm-link 2022-07-07 15:22:57 +02:00
Daniel Hofstetter
249b398906 comm: enable "output_delimiter" test 2022-07-07 15:22:43 +02:00
Daniel Hofstetter
ac35a1b985 comm: use NUL if delimiter is empty 2022-07-06 13:50:23 +02:00
Sylvestre Ledru
43a5b8c7d7
Merge pull request #3671 from niyaznigmatullin/fix_realpath_test
test_realpath: fixed test to be the one that was supposed to be
2022-07-06 09:42:15 +02:00
Jeffrey Finkelstein
4780690caa cp: copy attributes of dangling symbolic link
Fix a bug in which `cp` incorrectly exited with an error when
attempting to copy the attributes of a dangling symbolic link (that
is, when running `cp -P -p`).

Fixes #3531.
2022-07-03 15:17:00 -04:00
Gergely Kalas
bd96f25ec8 Add new test to verify GNU compatible quotation.
Co-authored-by: anastygnome <noreplygitemail@protonmail.com>
2022-07-01 16:43:09 +02:00
Daniel Hofstetter
220c3ca4fb numfmt: show error if --padding is zero 2022-07-01 13:34:05 +02:00
Sylvestre Ledru
f6a88552ab
Merge pull request #3667 from cakebaker/set_default_missing_value
uniq: set default missing value for "group" and "all-repeated" args
2022-07-01 00:01:21 +02:00
Daniel Hofstetter
72862512da uniq: set default missing value for args 2022-06-30 11:52:46 +02:00
Niyaz Nigmatullin
4e936d2d0d test_realpath: include issue id to ignored testcase 2022-06-30 11:52:17 +02:00
Niyaz Nigmatullin
9b2fa39760 test_realpath: get back to contains to pass in MacOs 2022-06-30 11:52:17 +02:00
Niyaz Nigmatullin
b3642b64c5 test_realpath: reformatted using rustfmt 2022-06-30 11:52:17 +02:00
Niyaz Nigmatullin
1ecc789dea test_realpath: fixed test to be the one that was supposed to be and
added non-passing test
2022-06-30 11:52:17 +02:00
Daniel Hofstetter
113f0bd92b realpath: add "--no-symlinks" alias 2022-06-30 11:51:24 +02:00
Sylvestre Ledru
b6bb476aa0
Merge pull request #3659 from cakebaker/ticket_3637
paste: implement "-z" flag
2022-06-23 22:20:09 +02:00
Sylvestre Ledru
2fb743b72a
Merge pull request #3663 from niyaznigmatullin/fix_install_C_test
Fix install c test
2022-06-23 17:09:02 +02:00
Sylvestre Ledru
7c7c694837
Merge pull request #3657 from ElijahSink/main
closes #3650: install -V does not show the filename
2022-06-23 16:57:35 +02:00
Niyaz Nigmatullin
ba136ba3fb tests: add tests for install to check -C option usage 2022-06-22 21:30:59 +03:00
Daniel Hofstetter
cf605c24d0 unexpand: handle too large "tabs" arguments 2022-06-22 09:30:11 +02:00
Daniel Hofstetter
d0f608c69f paste: implement "-z" flag
Fixes #3637
2022-06-22 09:30:00 +02:00
ElijahSink
f62909c1ff
Merge branch 'uutils:main' into main 2022-06-22 00:45:41 -04:00
Jan Scheer
75edeea5e4
tail: reduce CPU load for polling (#3618)
* tail: reduce CPU load for polling

This reduces the CPU load for polling drastically (from ~80% down to ~5%)
by removing/fixing several previous workarounds related to polling,
while still passing all related GNU test-suite checks.
* set Notify::PollWatcher delay to: sleep_sec/10 instead of
  sleep_sec/100
* set recv_timeout to sleep_sec instead of sleep_sec/100
* remove the manual polling of watched files

Bugs:
* fix an issue with headers to consistently pass
"test_follow_name_retry_headers" and "gnu/tests/tail-2/overlay-headers.sh"

Code clean-up and refactor
* make fields of struct FileHandling private (and add getters/setters)
to ensure that the paths are absolute and match the paths returned by
Notify::Events
* replace calls to "crash!" with "return USimpleError"
* clean-up formatting
2022-06-21 22:21:19 +02:00
Elijah Sink
81c45cde47 tests/install: fix mistakes when adding previous 2022-06-20 17:31:10 -05:00
Elijah Sink
2965581847 tests/install: add failing test for #3650 2022-06-20 14:26:46 -05:00
Sylvestre Ledru
c277e933c9
Merge pull request #3647 from philgebhardt/backup-protect-source
cp: make `--b=simple` protective of source
2022-06-20 17:27:11 +02:00
Phil Gebhardt
30f03b3ded
use existing fixture file instead of new ones 2022-06-18 09:51:39 -07:00