Commit graph

303 commits

Author SHA1 Message Date
ReggaeMuffin
2eb32d845e
chores: run cargo +1.40.0 fmt
Apparently fmt from 1.40.0 is a bit more strict in some places

Let me know if this is worthwhile merging :)
2021-04-02 10:56:49 +01:00
Sylvestre Ledru
9c2cd81b11 refresh cargo.lock with recent updates 2021-04-01 23:18:57 +02:00
paulotten
090d29496a
Issue #1622 port du to windows (#1788)
* Issue #1622 port `du` to windows

* Attempt to support Rust 1.32

Old version was getting "attributes are not yet allowed on `if`
expressions" on Rust 1.32

* Less #[cfg]

* Less duplicate code.

I need the return and the semicolon after if otherwise the second #[cfg]
leads to unexpected token complilation error

* More accurate size on disk calculations for windows

* Expect the same output on windows as with WSL

* Better matches output from du on WSL

* In the absence of feedback I'm disabling these tests on Windows.
They require `ln`. Windows does not ship with this utility.

* Use the coreutils version of `ln` to test `du`

`fn ccmd` is courtesy of @Artoria2e5

* Look up inodes (file ids) on Windows

* One more #[cfg(windows)] to prevent unreachable statement warning on linux
2021-04-01 23:16:47 +02:00
Árni Dagur
7a947cfe46
cat: Improve performance on Linux (#1978)
* cat: Improve performance, especially on Linux

* cat: Don't use io::copy for splice fallback

On my MacBook Pro 2020, it is around 25% faster to not use io::copy.

* cat: Only fall back to generic copy if first splice fails

* cat: Don't double buffer stdout

* cat: Don't use experimental or-pattern syntax

* cat: Remove nix symbol use from non-Linux
2021-04-01 23:08:48 +02:00
Aleksandar Janicijevic
cf4970f083
shred: Replaced eprintln with show_error (#1992) 2021-04-01 08:53:48 +02:00
Yagiz Degirmenci
e958864bd9
tac: exit with proper code, move from getopts to clap, add test for invalid inputs (#1957) 2021-03-31 21:21:10 +02:00
Aleksandar Janicijevic
751ae6a8f8
shred: use clap for argument management (#1961) 2021-03-31 21:19:04 +02:00
Sylvestre Ledru
da18ffa496 refresh cargo.lock with recent updates 2021-03-30 20:54:25 +02:00
Árni Dagur
698dab12a6
wc: Don't read() if we only need to count number of bytes (Version 2) (#1851)
* wc: Don't read() if we only need to count number of bytes

* Resolve a few code review comments

* Use write macros instead of print

* Fix wc tests in case only one thing is printed

* wc: Fix style

* wc: Use return value of first splice rather than second

* wc: Make main loop more readable

* wc: Don't unwrap on failed write to stdout

* wc: Increment error count when stats fail to print

* Re-add Cargo.lock
2021-03-30 20:53:02 +02:00
Sylvestre Ledru
32ddef9b9e
refresh cargo.lock with recent updates (#1964) 2021-03-29 14:35:12 +02:00
electricboogie
da5f2f3a6c
sort: Add a GNU-style Random Sorter (#1922) 2021-03-29 13:05:52 +02:00
Yagiz Degirmenci
8cc7a90d7c
sum: fix crash on invalid inputs, move to clap, add tests (#1952) 2021-03-29 13:03:56 +02:00
Raymond Wang
ab5b6dd844
tr: move from getopts to claps #1929 (#1954) 2021-03-29 13:03:24 +02:00
Craig Pastro
6d4f70ccb2
shuf: move from getopts to clap (#1950) 2021-03-28 15:08:37 +02:00
Sylvestre Ledru
1bfea356a6 refresh cargo.lock with recent updates 2021-03-28 10:36:44 +02:00
Sylvestre Ledru
ab32fd2ba6 refresh cargo.lock with recent updates 2021-03-27 20:03:47 +01:00
Yagiz Degirmenci
f66a188414
mkfifo: general refactor, move to clap, add tests (#1945)
* mkfifo: general refactor, move to clap, add unimplemented flags

* chore: update Cargo.lock

* chore: delete unused variables, simplify multiple lines with crash

* test: add tests

* chore: revert the use of crash

* test: use even more invalid mod mode
2021-03-27 20:00:59 +01:00
Yagiz Degirmenci
ac7edcc4fa
ptx: delete getopts dependency (#1942)
* chore: delete getopts dependency

* deps: update Cargo.lock
2021-03-27 13:31:06 +01:00
Sylvestre Ledru
e1439dd199
refresh cargo.lock with recent updates (#1924)
Updating memoffset v0.6.1 -> v0.6.2
    Updating syn v1.0.64 -> v1.0.65
2021-03-27 10:06:22 +01:00
Antonio Gurgel
35675fdfe7
install: implement -C / --compare (#1811)
* install: implement `-C` / `--compare`

GNU coreutils [1] checks the following: whether
- either file is nonexistent,
- there's a sticky bit or set[ug]id bit in play,
- either file isn't a regular file,
- the sizes of both files mismatch,
- the destination file's owner differs from intended, or
- the contents of both files mismatch.

[1] https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/install.c?h=v8.32#n174

* Add test: non-regular files

* Forgot a #[test]

* Give up on non-regular file test

* `cargo fmt` install.rs
2021-03-27 09:18:47 +01:00
Sylvestre Ledru
f431f58dd8
Bump min rustc to 1.40 (#1909) 2021-03-25 15:28:47 -07:00
Sylvestre Ledru
365c230493
refresh cargo.lock with recent updates (#1896) 2021-03-24 08:56:30 +01:00
Sylvestre Ledru
734368bc92 refresh cargo.lock with recent updates 2021-03-21 17:03:58 +01:00
pedrohjordao
ca8fbc37bf
od: Changes command line parser to clap (#1849) 2021-03-21 16:19:30 +01:00
Sylvestre Ledru
d1fc42a7c9 refresh cargo.lock with recent updates 2021-03-20 10:28:06 +01:00
Sylvestre Ledru
621511dcac Update cargo.lock 2021-03-19 14:24:25 +01:00
Marco Satti
5ec87dc70a
date: Implement setting the date on Unix & Windows (#1798)
* date: implement set date for unix and windows

Parsing the date string is not fully implemented yet, as in it relies
on the internals of chrono - things like "Mon, 14 Aug 2006 02:34:56 -0600"
do not work, nor does "2006-08-14 02:34:56" (no TZ / local time). This
is no different to using the "--date" option however, and will get fixed
when `parse_date` is a bit smarter.

Only supports unix and Windows platforms for now.
2021-03-19 09:54:01 +01:00
aspen
ed7e24c5b0
uu_more: update nix to 0.13 2021-03-18 08:39:06 -04:00
Sylvestre Ledru
99be7a3172
Merge pull request #1810 from jeckersb/nice-clap
nice: move from getopts to clap #1794
2021-03-17 22:03:42 +01:00
Sylvestre Ledru
44a7adc9a0
Merge pull request #1812 from konomith/feature/preserve_timestamps_#1758
install: Implement --preserve-timestamps (-p)
2021-03-17 22:02:54 +01:00
John Eckersberg
64b8c8aac7 nice: move from getopts to clap #1794 2021-03-17 08:52:13 -04:00
Sylvestre Ledru
19b7b09bd7
Update cargo.lock (#1819) 2021-03-14 11:09:11 +01:00
Hari
2462575d4b
Run cargo +1.33.0 update to fix Cargo.lock 2021-03-12 17:46:58 -05:00
Sylvestre Ledru
cd4003007f refresh cargo.lock with updates 2021-03-12 23:10:12 +01:00
Hari
68ec2ed0f3
install: Implement --preserve-timestamps (-p)
Last access and last modify timestamps are extracted from the
existing file metadata and are applied to the newly created file.
2021-03-12 16:51:47 -05:00
Ali Shariat
62388faab8
paste: update cargo lock file
missed from #1785
2021-03-10 02:04:37 -08:00
Sylvestre Ledru
f711027764 refresh Cargo.lock after the version 2021-03-07 12:05:16 +01:00
Sylvestre Ledru
4f5e9ecb39 refresh Cargo.lock after the version 2021-03-07 11:29:38 +01:00
Chad Brewbaker
bb54669a5d
Fix macOS aarch64 compile errors (#1724) 2021-02-23 10:25:06 +01:00
Alex Lyon
7e5d9ee32d
factor, stdbuf, timeout, uname, uptime: update dependencies (#1746) 2021-02-22 15:07:51 +01:00
Sylvestre Ledru
158754f4ab
Fix the min rust version (#1720) 2021-02-12 11:36:50 +01:00
Sylvestre Ledru
262b508b89 update the dep to uucore 0.0.6 2021-02-01 23:55:43 +01:00
Sylvestre Ledru
dc53b9bbf3 Also pin thread_local to version 1.1.0 2021-02-01 23:32:55 +01:00
Sylvestre Ledru
f0b302d716 refactor(fmt) move to clap 2021-01-25 21:48:52 +01:00
Sylvestre Ledru
a807fc623a Update to version 0.0.3 2021-01-22 09:40:38 +01:00
Sylvestre Ledru
9f7259b986 refactor(realpath): move to clap 2021-01-19 20:56:27 +01:00
Sylvestre Ledru
e331186fee
unbreak build with rustc 1.32: force tempfile 3.1.0 (#1695) 2021-01-19 08:15:53 +01:00
Gaurang Tandon
ac7cac2910
tail: moving to clap from getopt (#1689) 2021-01-12 17:44:11 +01:00
Sylvestre Ledru
04b92f3e94
Replaces failure by thiserror. (#1688)
Failure isn't maintained anymore:
https://github.com/rust-lang-nursery/failure/pull/347
https://rustsec.org/advisories/RUSTSEC-2020-0036.html
2021-01-11 22:01:14 +01:00
Sylvestre Ledru
57e24c9118 also update uucore & uucore_procs versions to 0.0.5 2021-01-10 18:24:43 +01:00