Commit graph

7340 commits

Author SHA1 Message Date
Gilad Naaman
8535cd41e0 Fix type-error when calling parse_size from sort 2022-02-22 13:49:20 +01:00
Omer Tuchfeld
5d861df961 Fix type-error when calling parse_size from tail 2022-02-22 13:49:20 +01:00
Omer Tuchfeld
8d8e25880e Fix type-error when calling parse_size from head 2022-02-22 13:49:20 +01:00
Omer Tuchfeld
0fe6017006 Fix type-error when calling parse_size from du 2022-02-22 13:49:20 +01:00
Omer Tuchfeld
88dfb8d374 Fix type-error when calling parse_size from dd 2022-02-22 13:49:15 +01:00
Omer Tuchfeld
b6c952c46e Fix parse_size to use u64 rather than usize for better 32-bit support
Using usize limits 32-bit platforms to operate only on sizes of 4GiB
or less. While 32-bit platforms only have 4GiB of addressable memory,
not all operations require the data to be entirely in memory, so this
limitation can be lifted if we use u64 instead of usize.

This only fixes the core function, further commits fix the utilities
making use of this function.
2022-02-22 11:09:40 +01:00
Alex Tibbles
163472ff7b
hashsum: pass spell checker 2022-02-21 20:43:42 -05:00
Alex Tibbles
3a0f292510
hashsum: refactor macro name 2022-02-21 17:04:57 -05:00
Alex Tibbles
afd5fea3c8
hashsum: refactor MD5 to use macro 2022-02-21 17:00:34 -05:00
Alex Tibbles
b1c543b4d2
hashsum: re-factor SHA1 implementation into common macro 2022-02-21 16:58:20 -05:00
Alex Tibbles
00d3c36e8c
update SHA1, SHA2, SHA3 crates 2022-02-21 16:55:59 -05:00
Alex Tibbles
41e9719d6b
upgrade to RustCrypto Hashes MD5 "MD-5" 0.10.1 2022-02-21 16:51:00 -05:00
Sylvestre Ledru
38bcafb7c2
Merge pull request #3174 from alextibbles/hashsum-update-hex
hashsum: update hex to 0.4.3
2022-02-21 22:23:03 +01:00
Alex Tibbles
c8346fd720
hashsum: update hex to 0.4.3
Update to API change.
2022-02-21 15:35:46 -05:00
Sylvestre Ledru
6c7decc42b
Merge pull request #3172 from alextibbles/update-strum
uniq: update strum to 0.23 latest
2022-02-21 19:28:55 +01:00
Sylvestre Ledru
775588fb18
Merge pull request #3127 from xxyzz/df
df: some option changes
2022-02-21 19:08:56 +01:00
Jeffrey Finkelstein
9f367b72e6 dd: pad partial record with spaces in some cases
If `conv=block,sync` command-line arguments are given and there is at
least one partial record read from the input (for example, if the
length of the input is not divisible by the value of the `ibs`
argument), then output an extra block of `cbs` spaces.

For example, no extra spaces are printed in this example because the
input is of length 10, a multiple of `ibs`:

    $ printf "012\nabcde\n" \
    > | dd ibs=5 cbs=5 conv=block,sync status=noxfer \
    > && echo $
    012  abcde$
    2+0 records in
    0+1 records out

But in this example, 5 extra spaces are printed because the length of
the input is not a multiple of `ibs`:

    $ printf "012\nabcdefg\n" \
    > | dd ibs=5 cbs=5 conv=block,sync status=noxfer \
    > && echo $
    012  abcde     $
    2+1 records in
    0+1 records out
    1 truncated record

The number of spaces printed is the size of the conversion block,
given by `cbs`.
2022-02-21 13:00:11 -05:00
Alex Tibbles
0d5dd27e71
uniq: update strum to 0.23 latest 2022-02-21 12:34:25 -05:00
Sylvestre Ledru
f11ac4b076
Merge pull request #3166 from sylvestre/rust-cache
try to use rust-cache on github action to build faster
2022-02-21 17:35:22 +01:00
Terts Diepraam
53070141c1
all: add format_usage function (#3139)
This should correct the usage strings in both the `--help` and user documentation. Previously, sometimes the name of the utils did not show up correctly.
2022-02-21 17:14:03 +01:00
alextibbles
cd450cc591
expr: update onig crate to 6.3 (#3136)
* expr: update onig crate to 6.3
2022-02-21 17:13:27 +01:00
Sylvestre Ledru
419abec4e5
Merge pull request #3148 from jfinkels/dd-of-dev-null
dd: don't error when outfile is /dev/null
2022-02-21 17:10:42 +01:00
Sylvestre Ledru
8583ed8272
Merge pull request #3169 from xxyzz/main
Run GNU root tests after other tests
2022-02-21 11:12:31 +01:00
Sylvestre Ledru
8e0a40d6b1
Merge pull request #3170 from jfinkels/dd-blocks-module
dd: move block-related functions into new module
2022-02-21 10:51:23 +01:00
Jeffrey Finkelstein
1076fbd492 dd: move block-related functions into new module
Create a new module `blocks.rs` to contain the block-related helper
functions. This commit only moves the location of the code and related
tests, it does not change the functionality of `dd`.
2022-02-20 22:16:54 -05:00
Terts Diepraam
938c5acbbe
Merge pull request #3146 from ndd7xv/split-suffix-check
split: error when num. of chunks is greater than num. of possible filenames
2022-02-20 17:12:05 +01:00
xxyzz
744592e221
Change the owner of gcda files to the current user 2022-02-20 19:15:48 +08:00
xxyzz
fe8910350c
Run GNU root tests at the end
This should fix the profiling permission denied error on non-root tests
2022-02-20 18:29:18 +08:00
Sylvestre Ledru
9adaf5c288
Merge pull request #3045 from xxyzz/main
Create coverage report for GNU tests
2022-02-20 10:57:12 +01:00
Sylvestre Ledru
bc3f540a1b
Merge pull request #2965 from tertsdiepraam/test-wsl-exec-permission
`test`: fix wsl executable permission
2022-02-20 10:36:13 +01:00
Sylvestre Ledru
73051809a7
Merge pull request #3018 from Narasimha1997/fix-cp-recursion
Fix: Avoid infinite recursion when source and destinations are same while using `cp -R`
2022-02-20 10:34:34 +01:00
Sylvestre Ledru
42eba6c5b2
Merge pull request #3107 from jfinkels/split-elide-empty-files
split: add support for -e argument
2022-02-20 10:32:57 +01:00
Sylvestre Ledru
6bf575ad56
Merge branch 'main' into cp-lb 2022-02-20 10:31:13 +01:00
Sylvestre Ledru
5bbc2cedf4
Merge pull request #3054 from jfinkels/dd-progress-module
dd: collect progress reporting into its own module
2022-02-20 10:17:54 +01:00
Sylvestre Ledru
83d2f550ab try to use rust-cache on github action to build faster 2022-02-19 21:26:34 +01:00
Sylvestre Ledru
f222dedf85
Merge pull request #3164 from palaster/fix-issue-3162
Added b2sum and b3sum utility entries
2022-02-19 21:12:39 +01:00
Pat Laster
2cd84c2b70 Added b2sum and b3sum utility entries 2022-02-19 11:41:51 -06:00
Jeffrey Finkelstein
b09bae2acf dd: collect progress reporting into its own module
Collect structs, implementations, and functions that have to do with
reporting number of blocks read and written into their own new module,
`progress.rs`. This commit also adds docstrings for everything and
unit tests for the significant methods. This commit does not change
the behavior of `dd`, just the organization of the code to make it
more maintainable and testable.
2022-02-19 10:39:40 -05:00
Jeffrey Finkelstein
6900638ac6 dd: don't error when outfile is /dev/null
Prevent `dd` from terminating with an error when given the
command-line argument `of=/dev/null`. This commit allows the call to
`File::set_len()` to result in an error without causing the process to
terminate prematurely.
2022-02-19 10:29:09 -05:00
Terts Diepraam
1a7e5c4cc5
Merge pull request #3154 from jfinkels/dd-truncated-records
dd: correct order and phrasing of truncated record
2022-02-19 15:58:12 +01:00
Terts Diepraam
c56a879a68
Merge pull request #3160 from sylvestre/doc-order
user docs: move the examples after the options
2022-02-19 15:53:37 +01:00
Sylvestre Ledru
be0b77e7a7 when help item has an \n, translate it to a <br />
example:
https://uutils.github.io/coreutils-docs/user/utils/ls.html / classify
2022-02-19 13:44:15 +01:00
Sylvestre Ledru
716444c7b1 user docs: move the examples after the options 2022-02-19 12:46:57 +01:00
Sylvestre Ledru
bbd74bb957
Merge pull request #3159 from crazystylus/expr-missing-help-docs
`expr`: fix missing help in user docs
2022-02-19 11:04:14 +01:00
Sylvestre Ledru
7870317178
Merge pull request #3152 from tertsdiepraam/docs-examples
docs: add examples from tldr-pages
2022-02-19 09:49:45 +01:00
Kartik Sharma
c523aa43f2 Fixes missing help on expr user docs.
- Configured clap to take crate version, so version is now visible in docs.
- Added ABOUT string from expr help output, so about section is getting rendered in docs.
- Added USAGE section.
- Added HELP section for each args.
2022-02-19 13:47:16 +05:30
Jeffrey Finkelstein
766c85fb5e dd: correct order and phrasing of truncated record
Place the "truncated records" line below the "records out" line in the
status report produced by `dd` and properly handle the singularization
of the word "record" in the case of 1 truncated record. This matches
the behavior of GNU `dd`.

For example

    $ printf "ab" | dd cbs=1 conv=block status=noxfer > /dev/null
    0+1 records in
    0+1 records out
    1 truncated record

    $ printf "ab\ncd\n" | dd cbs=1 conv=block status=noxfer > /dev/null
    0+1 records in
    0+1 records out
    2 truncated records
2022-02-18 23:49:33 -05:00
Terts Diepraam
4719717e33
Merge pull request #3128 from jfinkels/dd-zero-multiplier-regression
dd: remove spurious zero multiplier warning
2022-02-19 01:37:33 +01:00
Terts Diepraam
625c771d14
Merge pull request #3112 from ndd7xv/err_conv-to-result
uucore(memo): replace err_conv with result
2022-02-19 01:29:07 +01:00
Terts Diepraam
69a94e412b docs: use rust libraries for downloading and unzipping tldr 2022-02-19 01:27:19 +01:00