Commit graph

3434 commits

Author SHA1 Message Date
Laurent Cheylus
62ec71d6fa
tests: disable failed tests for chown on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:29:12 +02:00
Laurent Cheylus
b69070fdff
tests: disable failed tests for cat on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:29:12 +02:00
Daniel Hofstetter
8cc129cff8
Merge pull request #6528 from sylvestre/cf
ls: when -CF is passed, use a tab. closes: #5396
2024-07-05 10:38:31 +02:00
Pyokyeong Son
ea478c2bb6
ls: fixed dired option (-D) not outputting datetime and parent dir byte offsets (#6538)
Closes #6522
2024-07-05 09:59:41 +02:00
Daniel Hofstetter
b774000351
Merge pull request #6535 from sylvestre/sort
sort: improve the error mgmt with --batch-size
2024-07-05 09:45:54 +02:00
Mengsheng Wu
1e80d3e3b2
ls: fix error sub dir output (#6521)
Closes #6492
2024-07-05 08:16:16 +02:00
Sylvestre Ledru
fd2c4a14b8 ls: when -CF is passed, use a tab. closes: #5396 2024-07-04 23:39:03 +02:00
Sylvestre Ledru
e2c66ea092 sort: improve the error mgmt with --batch-size
should make the gnu test tests/sort/sort-merge.pl pass
2024-07-04 22:16:46 +02:00
Daniel Hofstetter
a18c132994
Merge pull request #6524 from sylvestre/cksum-3
cksum: read the next file when the first is missing or invalid
2024-07-03 09:48:08 +02:00
Sylvestre Ledru
14230e3c68
Merge pull request #6526 from Its-Just-Nans/add-test-date
date: add test
2024-07-03 08:10:20 +02:00
Ben Wiederhake
8f6eb57856 common: permit signal names of any casing in tests 2024-07-03 04:15:52 +02:00
Ben Wiederhake
449c685675 uucore+timeout: accept signals of any casing 2024-07-03 04:15:52 +02:00
n4n5
e506927f1f
ls: add test 2024-07-02 22:40:06 +02:00
Sylvestre Ledru
a6c5ee576a cksum: read the next file when the first is missing or invalid 2024-07-02 20:48:28 +02:00
n4n5
9846af40e5
add date test 2024-07-02 20:07:06 +02:00
Sylvestre Ledru
4720f8a076
Merge pull request #6513 from cvonelm/main
tr: correctly detected matched [:upper:]
2024-07-01 17:24:42 +02:00
kf zheng
e6b6b2761b
printf: Check precision before writing into stdout (#6511)
* Add a new error type InvalidPrecision

* check if the precision is valid before writing to stdout when it is signedInt, unsigned, or float

* add tests for invalid precision check

* add tests for invalid precision check

* fix possible cross-platform issue that code failing to pass on some tests

* uucore/format: inline var in format string

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-07-01 15:15:32 +02:00
Sylvestre Ledru
96fa8e9480
Merge pull request #6514 from lcheylus/openbsd-uptime
uptime: add support for OpenBSD using utmp
2024-06-30 21:27:48 +02:00
Sylvestre Ledru
9013265e47
Merge pull request #6506 from Its-Just-Nans/touch-directory
`touch`: change message when directory
2024-06-30 20:54:48 +02:00
n4n5
635ad16c63
touch: change message when trailing slash 2024-06-30 19:00:54 +02:00
Sylvestre Ledru
9c0f2f84ab
Merge pull request #6505 from Its-Just-Nans/fix-clippy-errors
Fix clippy errors
2024-06-30 18:55:51 +02:00
n4n5
ab67947321
fix clippy tests 2024-06-30 16:27:08 +02:00
Laurent Cheylus
c0a3662b63
tests: enable tests for uptime on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-06-30 16:17:04 +02:00
Christian von Elm
866366a874 tr: correctly detected matched [:upper:]
tr detects if a class in set2 is matched by a class at the correct position in set1 after it has expanded everything before the class in both sets:

So

tr 'abcd[:upper:]' 'a-d[:lower:]'

should not fail
2024-06-30 14:24:00 +02:00
Sylvestre Ledru
e08c43ade2
Merge pull request #6496 from djedi23/6267-cp-preserved-hardlinks-are-not-reported-in--verbose
cp: fix preserved hardlinks are not reported in --verbose
2024-06-29 10:46:31 +02:00
sreehari prasad
dbeae9f444
ls: gnu color-clear-to-eol fix (#6507)
---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2024-06-29 10:06:00 +02:00
Daniel Hofstetter
f451714d26
Merge pull request #6406 from jadijadi/users-openbsd
users: support OpenBSD using utmp
2024-06-29 07:52:10 +02:00
Jadi
576341bb93 users: support OpenBS using utmp
OpenBSD uses the original utmp file format so the general `users` does not
work there. By using the `utmp-classic` lib, we cna process the current users
on the system from the /var/run/utmp and show the list.

fixes #5665
2024-06-29 08:19:24 +03:30
Daniel Hofstetter
69b603bfe7
Merge pull request #6503 from CausingBrick/issue-6495
date: fix date get timezone error while set utc time (#6495)
2024-06-28 16:15:56 +02:00
MengshengWu
e4ec608781 date: fix date get timezone error while set utc time (#6495) 2024-06-28 22:01:00 +08:00
Sylvestre Ledru
0ecc18fb5b hashsum/b2sum: when the checksum file is untagged, detect the size
Should fix tests/cksum/b2sum.sh
2024-06-28 10:15:27 +02:00
Daniel Hofstetter
9b3b9e8407
Merge pull request #6452 from sylvestre/base64
cksum/hashsum: add support of --check with base64  + other improvs
2024-06-27 09:47:52 +02:00
Moïse Valvassori
2e223dfdfc cp: fix preserved hardlinks are not reported in --verbose 2024-06-26 06:44:55 +02:00
Sylvestre Ledru
66ccb1a479 cksum/hashsum: add support of --check with base64 2024-06-25 19:00:23 +02:00
sreehari prasad
92665144c9
ls: gnu color-norm test fix (#6481) 2024-06-24 21:38:10 +02:00
Daniel Hofstetter
92c3de5387
Merge pull request #6144 from sylvestre/dired
ls --dired: adjust our code after GNU v9.5
2024-06-24 13:41:11 +02:00
Sylvestre Ledru
ececddd672 ls: If we have --dired --hyperlink, we don't show dired but we still want to see the
long format

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-06-24 10:27:37 +02:00
Sylvestre Ledru
4d705621e6 ls: --format will override the --dired option
Closes: #6488

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2024-06-23 21:13:37 +02:00
Christian von Elm
0ae6d43536
Refuse to translate if set2 contains more than one unique characters and set1 contains a character class (#6472)
* Refuse to translate if set2 contains > 1 unique characters
2024-06-22 19:30:39 +02:00
Anirban Halder
2774274cc2
`uptime`: Support files in uptime (#6400) 2024-06-22 13:06:03 +02:00
Sylvestre Ledru
cd44a3d1fd ls --dired: v9.5 --hyperlink is ignored if passed first
Manages cases like:
$ ls -R --dired --hyperlink a2
will show hyperlink
$ ls -R --hyperlink --dired a2
won't
2024-06-22 09:32:21 +02:00
Sylvestre Ledru
da11981026 ls --dired: v9.5 automatically set --format=long 2024-06-21 23:32:20 +02:00
sreehari prasad
e46ad30434
gnu cp-parents test case (#6446) 2024-06-17 11:16:26 +02:00
Christian von Elm
a46e4fd290 Refuse to translate if set1 is longer than set2 and set2 ends in a character class
tr [:lower:]a [:upper:]

fails in GNU tr, so print an error for tr too.
2024-06-15 12:38:19 +02:00
Daniel Hofstetter
97c1633b5e clippy: fix warnings introduced by Rust 1.79 2024-06-14 07:55:31 +02:00
Daniel Hofstetter
38344edacf
Merge pull request #6445 from cvonelm/6341-tr-unaligned-upper
tr: A [:lower:]/[:upper:] in set2 must be matched in set1
2024-06-10 10:52:08 +02:00
Daniel Hofstetter
f56e121eb0
Merge pull request #6431 from sylvestre/refactor-hashsum-cksum
cksum/hashsum: refactor the common code.
2024-06-04 09:06:35 +02:00
Sylvestre Ledru
1cbb4d9752 cksum/hashsum: improve the tests and wording 2024-06-03 19:43:20 +02:00
Sylvestre Ledru
773d8cfbc6 cksum/hashsum: fix the windows tests + improve some 2024-06-02 15:46:55 +02:00
Christian von Elm
7e8aaa8ad4 tr: A [:lower:]/[:upper:] in set2 must be matched in set1
If there is a [:lower:] or [:upper:] in set2, then there must be a [:lower:] or [:upper:] at the
same logical position in set1

So

tr -t [:upper:] [:lower:] works
tr -t 1[:upper:] [:lower:] doesnt
2024-06-02 14:22:17 +02:00
sreehari prasad
8cac375ddd
cp: gnu test case preserve-mode fix (#6432) 2024-05-30 21:12:55 +02:00
Sylvestre Ledru
1cf6700023 cksum/hashsum: manage the '*' start correctly 2024-05-29 09:08:04 +02:00
Sylvestre Ledru
84d90fcbdf cksum/hashsum: try to detect the format faster the first line 2024-05-29 09:08:04 +02:00
Sylvestre Ledru
2c83b28d18 hashsum: improve the file verification algo.
We have 3 different kinds of input:
* "algo (filename) = checksum"
  example: `BLAKE2 (a) = bedfbb90d858c2d67b7ee8f7523be3d3b54004ef9e4f02f2ad79a1d05bfdfe49b81e3c92ebf99b504102b6bf003fa342587f5b3124c205f55204e8c4b4ce7d7c`
* "checksum  filename"
  example: `60b725f10c9c85c70d97880dfe8191b3  a`
* "checksum filename"
  example: `60b725f10c9c85c70d97880dfe8191b3 a`

These algo/regexp are tricky as files can be called "a, " b", " ", or "*c".
We look at the first time to analyze the kind of input and reuse the same regexp then.
2024-05-29 09:08:04 +02:00
Sylvestre Ledru
6acc8e695f hashsum: Implement the quiet mode 2024-05-29 09:08:04 +02:00
Sylvestre Ledru
89b7a1a8fb hashsum: handle the case when md5sum is used but the file contains a different algo 2024-05-29 09:08:04 +02:00
Sylvestre Ledru
0882eea07c cksum/hashsum: factor the error structure and use it more 2024-05-29 09:08:04 +02:00
Sylvestre Ledru
dbe7a20e08 cksum/hashsum: refactor the common code.
Summary of the change:
* Move the common code into checksum
* Create a structure HashAlgorithm to handle the algorithm (instead of the 3 variables)
* Use the same function for cksum & hashsum for --check (perform_checksum_validation)
* Use the same for function for the hash generation (digest_reader)
* Add unit tests
* Add integration tests
* Fix some incorrect tests
2024-05-29 09:08:00 +02:00
Daniel Hofstetter
8d3181fed5 df: fix incorrect test & add another test 2024-05-27 11:53:12 +02:00
Sylvestre Ledru
09e53f3d2d tests: fix some clippy warnings 2024-05-25 09:06:16 +02:00
Christian von Elm
0d1bde2879 tr: disallow classes besides [:upper:]/[:lower:] in set2 when translating
Fixes issue #6342
2024-05-23 22:06:57 +02:00
Walid
ebcd86df07
env: adds --ignore-signal (#6377)
* env: adds --ignore-signal
This commit implement #6164.

* env: handle STOP signal and fix styling issue

* env: fix encoded bytes

* env: adds SAFETY comment and handle special signals in ignore_signal

* env: fix parsing to have compatible behaviour

* env: remove derive from Options

* env: changed safety comment, handle duplications after parsing and non-unix cfg

* env: adds tests for ignore-signal parsing and invalid and special signals

* env: change signal values to be non-constant

* env: adds testing for signal ignoring

* env: styling and remove unix specific derive

* test_env: add SIGSTOP to cspell workspace wordlist

* env: makes signal handling unix specific

* env: make ignore-signal function invocation unix specific

* test_env: make signal vector use slices ref instead of vec (linter)

* env: makes ignore-signal in options unix specific

* test_env: add unix specific import
2024-05-23 22:01:39 +02:00
Daniel Hofstetter
a816960c33 tests: remove 'target_pointer_width = "128"' 2024-05-20 23:27:53 +02:00
sreehari prasad
f2f4a424de
cp: parent-perm-race gnu fix (#6403) 2024-05-20 08:17:17 +02:00
sreehari prasad
3c096ee6ac
util: added umask manipulation (#6404)
Co-authored-by: Terts Diepraam <terts.diepraam@gmail.com>
2024-05-19 21:56:41 +02:00
sreehari prasad
2e16cbbd7a
cp: link-deref gnu test fix (#6378)
Co-authored-by: Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
2024-05-19 10:14:29 +02:00
Ben Wiederhake
b718f954e8
Merge pull request #6390 from sylvestre/cksum-check
cksum: implement check (Closes: #5705)
2024-05-18 23:46:58 +02:00
Sylvestre Ledru
3156ad8298
Merge pull request #6412 from sylvestre/hashsum-fix
hashsum: improve the blake2 --tag export
2024-05-18 16:34:43 +02:00
Sylvestre Ledru
a9a11f486e hashsum: rename the blake2b algo with --tag + manage the different length 2024-05-18 16:16:26 +02:00
Sylvestre Ledru
514d810371 cksum: improve the blake2b detection algo corner case 2024-05-17 22:09:41 +02:00
Sylvestre Ledru
db58d2b6b5 cksum: when length/bits can't be divided by 8, generate an error 2024-05-17 22:08:53 +02:00
Sylvestre Ledru
1b78102a6b cksum: fails in case of unknown algo 2024-05-17 20:21:14 +02:00
Sylvestre Ledru
9c52ca8d55 cksum: also handle the case when the line start with ' \' 2024-05-15 11:46:58 +02:00
Dorian Péron
105024e708 ls: Fix quoting alignment 2024-05-15 09:59:38 +02:00
Dorian Péron
147c0b6962 tests(ls): Test space alignment when quoting is involved on grid output 2024-05-15 09:59:38 +02:00
Dorian Péron
0209c90b4e tests(ls): Test default quoting style on TTY output 2024-05-15 09:59:38 +02:00
Sylvestre Ledru
58c2b5d421 cksum: add failing tests - to be fixed 2024-05-14 23:27:50 +02:00
Sylvestre Ledru
115b203b22 cksum: also show the error on stdout 2024-05-14 23:27:50 +02:00
Sylvestre Ledru
07d579c40a cksum: handle the empty lines (and just spaces) 2024-05-14 23:27:50 +02:00
Sylvestre Ledru
bbd80e4061 cksum: various improvements/fixes 2024-05-14 23:27:47 +02:00
Sylvestre Ledru
843275a136 cksum/blake2b: improve the error management 2024-05-14 23:21:56 +02:00
Sylvestre Ledru
8ddb2131df cksum/blake2b, when length=512, don't add it in the line 2024-05-14 23:21:56 +02:00
Sylvestre Ledru
1aec8b407d chksum: add support of --check --algorithm=xxx 2024-05-14 23:21:56 +02:00
Sylvestre Ledru
81500ae3b8 cksum: implement check & strict 2024-05-12 21:20:58 +02:00
Daniel Hofstetter
320bdcf29e tail: remove useless use of vec! in test 2024-05-12 15:32:24 +02:00
Daniel Hofstetter
692cdfac34 cp/tail: use #[ignore] to disable tests
instead of a cfg attribute
2024-05-12 15:15:44 +02:00
Anirban Halder
1a5639b7d2
Fix ls: panicking on dangling symlink with --color=auto -l (#6346)
* Fixed unwrap being called on dereferenced dangling symlink

* Added test

* Switched to regex matching in test

* Remove unnecessary mkdir call

* Modified documentation of the test and added assertion of the colors

* Fixed a typo
2024-05-11 21:07:44 +02:00
Jadi
9303f8e5b1 Disabling compare_xattrs cp and mv related tests on OpenBSD
The test_cp and test_mv have xattr related tests. They should
be disabled on OpenBSD after commit 19d42c0339 disabled the
compare_xattrs function on OpenBSD.

Fixes #6348
2024-05-09 18:24:39 +02:00
Daniel Hofstetter
0ad7389b61 tail: remove #[cfg(not(windows))] from const 2024-05-09 15:28:34 +02:00
Daniel Hofstetter
aef7933d96 tail: use #[ignore] to disable tests
instead of a cfg attribute
2024-05-09 15:07:10 +02:00
Anirban Halder
97f8361737 Switched to using at.symlink_file instead of ln in tests 2024-05-08 23:50:33 +02:00
Anirban Halder
88d9d46abc Added test for dangling symlink in target directory 2024-05-08 23:50:33 +02:00
Anirban Halder
1f81912b3c Added assertion of stderr strings for macos and windows and fixed lints 2024-05-08 23:50:33 +02:00
Anirban Halder
f7e55b1322 Added overwrite detection for existing symlinks 2024-05-08 23:50:33 +02:00
Sylvestre Ledru
eb6f1df3bc cksum: add an ignored test for issue 6375 2024-05-07 20:24:25 +02:00
Sylvestre Ledru
ee2772925a cksum: --tag & --untagged - the order of usage matters. manage it 2024-05-07 20:24:25 +02:00
Sylvestre Ledru
9e080a3684 cksum: handle a corner case 2024-05-07 20:24:25 +02:00
Sylvestre Ledru
234f2f9508 cksum: handle an error like GNU 2024-05-07 20:24:25 +02:00
Sylvestre Ledru
10d8fd6f98 cksum: add binary and prepare the rest 2024-05-07 20:24:25 +02:00
Sylvestre Ledru
dc5342d115 hashsum: allow multiple usage of -l and take the last one
tested by gnu/tests/cksum/b2sum.sh
2024-05-07 20:24:25 +02:00