Commit graph

230 commits

Author SHA1 Message Date
Koutheir Attouchi
7010dfd939 runcon: added implementation and tests. 2021-08-22 21:59:41 +02:00
Sylvestre Ledru
5089214832 bump a few crates to simplify Debian packaging (second) 2021-08-22 00:42:03 +02:00
Koutheir Attouchi
83a515e4c3 chcon: reduce the number of unsafe blocks. 2021-08-10 13:50:51 -04:00
Jeremy Soller
783dd1ae01
install: do not compile on redox 2021-08-06 14:17:40 -06:00
Sylvestre Ledru
50b9d9f9a3
Merge branch 'master' into master 2021-08-06 09:26:39 +02:00
Koutheir Attouchi
090be5bb94 chcon: added implementation and integration tests
The ToDo list was updated to mark `chcon` as done.

Building and testing `chcon` requires enabling the `feat_selinux` feature. If `make` is used for building, then please specify `SELINUX_ENABLED=1` if building and testing on a system where SELinux is not enabled.
2021-08-05 22:57:57 -04:00
Michael Debertol
b8c383e210 basenc: add utility
basenc is a brand-new gnu core utility (added less than 3 years ago!),
which enables some more encodings.
2021-08-06 00:07:19 +02:00
Tyler
601c9fc620 Merge branch 'master' of https://github.com/uutils/coreutils into uutils-master-2 2021-08-03 17:33:43 -07:00
Jan Scheer
8232c1c64d
id: increase MSRV in order to compile selinux crate
* Bump MSRV from 1.43 to 1.47 in order to be able to compile
`selinux` crate 0.1.3

* Bump MSRV for clippy to 1.47

* Add "selinuxlib" to spell-checker
2021-08-02 20:36:06 +02:00
Tyler
9d9267e08b Addresses code-quality issues from testsdiepraam and miDeb.
- Removes dd from feat_require_unix (keeps it in feat_common_core)
- Changes name of make_linux_iflags parameter from oflags to iflags.
- Removes roughed out SIGINFO impl.
- Renames plen -> target_len.
- Removes internal fn def for build_blocks and replaces with a call to
  chunks from std.
- Renames apply_ct to the more descriptive apply_conversion
- Replaces manual swap steps in perform_swab with call to swap from std.
- Replaces manual solution with chunks where appropriate (in Read, and Write impl).
- Renames xfer -> transfer (in local variable names).
- Improves documentation for dd_filout/dd_stdout issue.
- Removes commented debug_assert statements.
- Modifies ProdUpdate to contain ReadStat and WriteStat rather than
  copying their fields.
- Addresses verbose return in `Output<File>::new(...)`
- Resoves compiler warning when built as release when signal handler fails to
  register.
- Derives _Default_ trait on ReadStat.
- Adds comments for truncated lines in block unblock tests
- Removes `as u8` in block unblock tests.
- Removes unecessary `#[inline]`
- Delegates multiplier string parsing to uucore::parse_size.
- Renames 'unfailed' -> 'succeeded' for clairity.
- Removes #dead_code warnings. No clippy warnings on my local machine.
- Reworks signal handler to better accomodate platform-specific signals.
- Removes explicit references to "if" and "of" in dd.rs.
- Removes explicit references to "bs", "ibs", "cbs" and "status" in
  parseargs.rs.
- Removes `#[allow(deadcode)]` for OFlags, and IFlags.
- Removes spellchecker ignore from all dd files.
- Adds tests for 'traditional' and 'modern' CLI.
2021-07-21 17:25:10 -07:00
Jan Scheer
6111cd6e1b
id: add note about conditional compiling to README section 2021-07-13 14:38:46 +02:00
Jan Scheer
7abc6a665e
id: add conditional compilation for selinux 2021-07-13 00:22:10 +02:00
Tyler
c3f9557581 Adds dd to feat_common_core 2021-07-12 13:53:31 -07:00
Tyler
994b4d9a3e Merge remote-tracking branch 'upstream/master' 2021-07-12 10:22:20 -07:00
Jan Scheer
92bc647ac3
Merge branch 'master' into id_selinux_context 2021-07-12 17:30:21 +02:00
Sylvestre Ledru
1d8a66b7d3 Update to version 0.0.7 2021-07-11 18:04:56 +02:00
Tyler
1ad89c5e89 Addresses issues raised in PR#2474
- runs rustfmt on test_dd.rs
- eliminates compiler warnings
- adds many words to spellchecker ignore list
- adds sanity test for vexing conv=nocreat issue. Still WIP.
2021-07-06 11:52:48 -07:00
Jan Scheer
e53f4db33a Merge branch 'master' into id_selinux_context 2021-07-06 13:29:50 +02:00
backwaterred
9c38583c6b
Merge pull request #2 from uutils/master
catchup with uutils main
2021-07-02 11:34:22 -07:00
Tyler
92281585a7 Merge branch 'master' of https://github.com/uutils/coreutils into uutils-master 2021-07-01 14:33:30 -07:00
Michael Debertol
2ebca384c6 all utils: enable wrap_help
This makes clap wrap the help text according to the terminal width,
which improves readability for terminal widths < 120 chars,
because clap defaults to a width of 120 chars without this feature.
2021-06-27 16:17:10 +02:00
Michael Debertol
a9e79c72c7 uutils: enable shell completions
This adds a hidden `completion` subcommand to coreutils. When invoked with
`coreutils completion <utility> <shell>` a completion file will be printed
to stdout. When running `make install` those files will be created for all
utilities and copied to the appropriate locations.
`make install` will install completions for zsh, fish and bash; however,
clap also supports generating completions for powershell and elvish.

With this patch all utilities are required to have a publich uu_app function
that returns a clap::App in addition to the uumain function.
2021-06-25 21:23:45 +02:00
Jan Scheer
f1d317147b id: add support for showing SELinux context (--context/-Z) 2021-06-20 13:44:41 +02:00
Terts Diepraam
eaa93e9c27 numfmt: move to common core 2021-06-20 00:25:02 +02:00
Terts Diepraam
be8e5f5f30 use the same spec for atty everywhere 2021-06-09 17:15:42 +02:00
Jan Scheer
26ad05cbb4 uucore: fix order of group IDs returned from entries::get_groups()
As discussed here: https://github.com/uutils/coreutils/pull/2361
the group IDs returned for GNU's 'group' and GNU's 'id --groups'
starts with the effective group ID.
This implements a wrapper for `entris::get_groups()` which mimics
GNU's behaviour.

* add tests for `id`
* add tests for `groups`
* fix `id --groups --real` to no longer ignore `--real`
2021-06-08 18:39:05 +02:00
Michael Debertol
e5c4681e04 tests: add the ability to set resource limits 2021-06-02 19:21:12 +02:00
Terts Diepraam
7690dc018f Merge branch 'master' into pr 2021-05-31 15:23:06 +02:00
Sylvestre Ledru
8c5dcd0765
Merge branch 'master' into implement-more 2021-05-31 10:17:15 +02:00
Terts Diepraam
bc1870c0a7 Merge branch 'master' into pr 2021-05-29 19:21:31 +02:00
Jan Scheer
fb812ff9d0 Cargo.toml: remove factor_benches in order to be able to run clippy
linting for all targets
2021-05-29 14:29:46 +02:00
Terts Diepraam
1c2540a613 Add atty to dev-deps for more tests 2021-05-28 21:07:38 +02:00
Sylvestre Ledru
222bd81190
Merge pull request #2291 from tertsdiepraam/remove-tempdir
Replace `tempdir` with `tempfile`
2021-05-28 10:45:19 +02:00
Terts Diepraam
ebe6341ae3 chore: replace tempdir with tempfile 2021-05-27 22:47:03 +02:00
Terts Diepraam
825476f573 Update tempfile 2021-05-27 20:25:24 +02:00
nicoo
00322b986b factor: Move benchmarks out-of-crate 2021-05-17 19:43:38 +02:00
Michael Debertol
2084c3ddf3 tests: show pretty diffs for assertion failures
- All assert_eq in tests/common/util.rs now print a pretty diff on test
failures.
- {stdout, stderr}_is_fixture now compare the expected output and the
fixture as Strings, which leads to more usable diffs.
2021-04-24 16:43:13 +02:00
Sylvestre Ledru
844e318a67
Merge branch 'master' into pr 2021-04-09 22:02:25 +02:00
Sylvestre Ledru
f37284129e new release 0.0.6 to address the cat issue 2021-04-03 16:06:58 +02:00
Sylvestre Ledru
ac031dffa4 new release 0.0.5 2021-04-03 10:30:07 +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
Ricardo Iglesias
5f17719a59
Implemented --indicator-style flag on ls. (#1907)
* Implemented --indicator-style flag on ls.

* Rust fmt

* Grouped indicator_style args.

* Added tests for sockets and pipes.

Needed to modify util.rs to add support for pipes (aka FIFOs).

* Updated util.rs to remove FIFO operations on Windows

* Fixed slight error in specifying (not(windows))

* Fixed style violations and added indicator_style test for non-unix systems
2021-03-29 13:10:13 +02: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
Max Semenik
62fe68850e pr: Fixes after rebasing
Only the minimum needed to:
* Make everything compile without warnings
* Move files according to the new project structure
* Make tests pass
2021-03-26 17:57:19 +03:00
tilakpatidar
2d58ea5f8b pr: print 56 lines of content with 5 blank trailer and header lines 2021-03-26 14:11:14 +03:00
Sylvestre Ledru
f431f58dd8
Bump min rustc to 1.40 (#1909) 2021-03-25 15:28:47 -07:00
Neculai Balaban
c6927d97c8
cp: add support for -x/--one-file-system (#1840) 2021-03-19 21:15:35 +01:00
ty
af6bf3a224 Begins work on dd
- Prototype code.
- Adds project boilerplate for integration with coreutils framework.
2021-03-16 14:32:55 -07:00
Sylvestre Ledru
6ad8528b99 update of the uucore dep to 0.0.7 2021-03-07 11:29:38 +01:00
Sylvestre Ledru
6481c5a247 Prepare version 0.0.4 2021-03-07 11:29:38 +01:00