Commit graph

1369 commits

Author SHA1 Message Date
Jan Scheer
59827bca1a
test_tail: add various tests for stdin-follow and stdin-redirect
* add various tests adapted from `gnu/tests/tail-2/follow-stdin.sh`
* explicitly set_stdin to null where needed, otherwise stdin is always
  `piped`
* tighten some existing tests (no_stderr, code_is, etc)
* add test for fifo
2022-05-16 22:02:47 +02:00
Jan Scheer
90a0226844
tail: improve support for polling
* Fix a timing related bug with polling (---disable-inotify) where some
Events weren't delivered fast enough by `Notify::PollWatcher` to pass all
of tests/tail-2/retry.sh and test_tail::{test_retry4, retry7}.

* uu_tail now reverts to polling automatically if inotify backend reports
too many open files (this mimics the behavior of GNU's tail).
2022-04-30 12:02:42 +02:00
Jan Scheer
5331a10a7b
tail: update README 2022-04-24 15:09:28 +02:00
Jan Scheer
6e1e3ac012
Merge branch 'main' into tail_notify 2022-04-23 00:26:59 +02:00
Jan Scheer
ceb2e993c0
tail: update readmes 2022-04-23 00:26:22 +02:00
Sylvestre Ledru
48a521224e
Merge pull request #3396 from jtracey/android2
fix Android support
2022-04-22 16:06:12 +02:00
Jan Scheer
6c096267bf
Merge branch 'main' into tail_notify 2022-04-21 23:55:54 +02:00
Jan Scheer
4a56d2916d
tail: fix handling of -f with non regular files
This makes uu_tail pass the "gnu/tests/tail-2/inotify-only-regular" test
again by adding support for charater devices.

test_tail:
* add test_follow_inotify_only_regular
* add clippy fixes for windows
2022-04-21 22:52:17 +02:00
Terts Diepraam
e8574ca184
Merge pull request #3418 from cakebaker/ticket_3409
df: show error if all types are excluded
2022-04-20 23:51:36 +02:00
Sylvestre Ledru
4ed3bbe705
Merge pull request #3423 from cakebaker/remove_trailing_spaces_in_rightmost_column
df: remove trailing spaces in rightmost column
2022-04-20 11:42:27 +02:00
Sylvestre Ledru
f6dafbc950
Merge pull request #3429 from cakebaker/ticket_3425
df: fix "File" column width for unicode filenames
2022-04-20 10:50:07 +02:00
Justin Tracey
2a0d58d060 get android builds to compile and pass tests 2022-04-20 08:44:49 +02:00
Justin Tracey
5e7d58650d fix null pointer derefs
The code for creating a Passwd from the fields of the raw syscall result
assumed that the syscall would return valid C strings in all non-error
cases. This is not true, and at least one platform (Android) will
populate the fields with null pointers where they are not supported.

To fix this and prevent the error from happening again, this commit
changes `cstr2string(ptr)` to check for a null pointer, and return an
`Option<String>`, with `None` being the null pointer case. While
arguably it should be the caller's job to check for a null pointer
before calling (since the safety precondition is that the pointer is to
a valid C string), relying on the type checker to force remembering this
edge case is safer in the long run.
2022-04-20 08:44:49 +02:00
Jan Scheer
7228902e55
Merge branch 'main' into tail_notify 2022-04-19 22:25:35 +02:00
Jan Scheer
eb21330ade
Merge branch 'main' into tail_notify 2022-04-19 22:14:55 +02:00
Terts Diepraam
cce2eebf98
Merge pull request #3420 from sylvestre/install-verbose
install: verbose - list all created directories
2022-04-19 18:56:57 +02:00
Daniel Hofstetter
9de407b1f0 df: fix "File" column width for unicode filenames
Fixes #3425
2022-04-19 11:09:46 +02:00
Daniel Hofstetter
cc4b28780b df: show error if all types are excluded
Fixes #3409
2022-04-19 09:10:37 +02:00
Daniel Hofstetter
576ec49fa5 df: remove trailing spaces in rightmost column 2022-04-19 08:13:35 +02:00
Daniel Hofstetter
0d7f99a21f df: fix broken "test_df_output_overridden" test 2022-04-19 07:46:00 +02:00
Sylvestre Ledru
d7cf3e7483
Merge pull request #3414 from gmnsii/main
df: -h -H shouldn't cause an error #3366
2022-04-18 22:24:36 +02:00
Sylvestre Ledru
7910eca71b install: verbose - list all created directories
$ install -Dv source_file1 sub3/a/b/c/file
install: creating directory 'sub3'
install: creating directory 'sub3/a'
install: creating directory 'sub3/a/b'
install: creating directory 'sub3/a/b/c'
'source_file1' -> 'sub3/a/b/c/file'
2022-04-18 22:06:02 +02:00
Sylvestre Ledru
ee50f408bd
Merge pull request #3419 from sylvestre/install-strip
install: When install --strip-program=foor fails, remove the target file
2022-04-18 19:29:26 +02:00
Terts Diepraam
ae24ca45f1
Merge pull request #3386 from cakebaker/ticket_3194
df: fix incorrect whitespace between columns
2022-04-18 11:13:33 +02:00
Sylvestre Ledru
6da73e6a6d install: When install --strip-program=foor fails, remove the target file
Should fix:
tests/install/strip-program.sh
2022-04-17 22:24:44 +02:00
Terts Diepraam
87f06637a9 tests/uniq: add GNU tests as Rust tests
tests/uniq: fix and uncomment test case 120
2022-04-17 16:50:18 +02:00
Daniel Hofstetter
a052855061 df: fix incorrect whitespace between columns
Fixes #3194
2022-04-17 14:00:52 +02:00
gmnsii
c9bf31f97e
Args override themselves and conflicting arguments 2022-04-17 01:52:05 -07:00
gmnsii
85d113ab79
df: -h -H shouldn't cause an error #3366 2022-04-16 07:51:24 -07:00
gmnsii
c2e214bd99
Add dir and vdir utils (based on ls)
Fix issue #3163

They are basically ls with some different options.
2022-04-15 17:30:40 +02:00
Daniel Hofstetter
a5477960a5 df: show error if specified type doesn't exist
Fixes #3252. As a side effect, "df -H -total" will now fail, too, as
expected.
2022-04-14 10:39:48 +02:00
Sylvestre Ledru
c23118bab4
Merge pull request #3387 from cakebaker/ticket_3355
df: fix calculation of IUse%
2022-04-13 15:11:41 +02:00
Sylvestre Ledru
10be79c095
Merge pull request #3150 from pyoky/mkdir-fix
mkdir: fixed not respecting set umask
2022-04-13 12:00:56 +02:00
Daniel Hofstetter
56e8dda606 df: fix calculation of IUse%
Fixes #3355
2022-04-13 11:19:24 +02:00
Sylvestre Ledru
920633c0ea mv: trigger an error when doing mv dir1 dir2 dir2 2022-04-12 22:37:38 +02:00
Sylvestre Ledru
57b8caf1d0 mv: move the tests in a separate function 2022-04-12 20:39:00 +02:00
Ashe Leclerc
76a74c65ab tests/mv: test interactive mvError
test -i flag in case of overwriting a non-directory with a directory
2022-04-12 09:28:11 +02:00
Sylvestre Ledru
f114d63b4e
Merge pull request #3376 from jfinkels/df-error-on-nonexistent-files
df: show error when file argument does not exist
2022-04-12 09:27:59 +02:00
Sylvestre Ledru
8b719a8591
du: add support for --exclude and --exclude-from (#3381)
* du: add support for --exclude and --exclude-from

And add an option --verbose (doesn't exist in GNU)
2022-04-11 22:50:01 +02:00
Jeffrey Finkelstein
460bd67050 df: show error when file argument does not exist
For example:

    $ df not-a-file
    df: not-a-file: No such file or directory

Fixes #3373.
2022-04-10 22:22:18 -04:00
Jeffrey Finkelstein
c5413167e2 df: correct --total argument used in unit test
Add a missing dash to the `--total` argument applied in the
`test_df_output` test case. Before this commit, the argument `-total`
was treated as a path argument. After this commit, `--total` is
treated as a command-line option that causes the total file usage to
be displayed.
2022-04-10 22:22:18 -04:00
Sylvestre Ledru
a2cefd9b52 du: Return non zero error code when dealing with permissions errors
Nd make the tests/du/no-x.sh & long-sloop.sh pass
2022-04-10 01:47:39 +02:00
Sylvestre Ledru
d0aa9a9927
Merge pull request #3343 from uutils/dependabot/cargo/lscolors-0.9.0
build(deps): bump lscolors from 0.7.1 to 0.9.0
2022-04-09 09:29:25 +02:00
Sylvestre Ledru
935bdd4210
Merge pull request #3368 from tertsdiepraam/msrv-1.56
Rust Edition 2021
2022-04-07 11:46:42 +02:00
Terts Diepraam
54b2fe700b fix regressed test due to lscolors update 2022-04-07 11:05:20 +02:00
Kai Lüke
e894e40c56
hashsum: add --no-names option from official b3sum tool (#3361)
* hashsum: add --no-names option from official b3sum tool

The official b3sum tool has a --no-names option for only printing the
hashes, omitting the filenames. This is quite handy when used from
scripts because it spares the postprocessing with "cut" or "awk".
Since the installed b3sum symlink would also serve as a drop-in for the
official tool, the --no-names option is expected to exist for
compatibility.

Add a --no-names option not only for b3sum but for hashsum in general
(and maybe GNU coreutils will also feel inspired to add this option).

Closes https://github.com/uutils/coreutils/issues/3360
2022-04-06 09:09:37 +02:00
Jan Scheer
a9fa94824d
tail: switch from Notify 5.0.0-pre.13 to 5.0.0-pre.14 2022-04-05 22:19:25 +02:00
Daniel Hofstetter
876924f5d5 df: show error if same type is included & excluded
Fixes #3302
2022-04-05 14:21:32 +02:00
Terts Diepraam
18369dc0be all: use array intoiterator 2022-04-05 10:39:31 +02:00
Sylvestre Ledru
cf722d7f0c tty: should not return 2 when --help is used
This is impacting
gnu/tests/misc/usage_vs_getopt.sh
2022-04-04 22:55:36 +02:00