Commit graph

238 commits

Author SHA1 Message Date
Jan Scheer
79d838b1c3
Merge branch 'master' into ls_selinux 2021-09-17 14:14:47 +02:00
Sylvestre Ledru
2a4422997d Restrict some crates to specific OS 2021-09-13 22:45:55 +02:00
Jan Scheer
4dc6536bb9
Merge branch 'master' into ls_selinux 2021-09-13 13:42:51 +02:00
Jan Verbeek
b7d697753c unlink: Simplify, remove unsafe, move to core
This makes it no longer possible to pass multiple filenames, but every
other implementation I tried (GNU, busybox, FreeBSD, sbase) also
forbids that so I think it's for the best.
2021-09-10 21:50:38 +02:00
Jan Scheer
fe3645d4d5
ls: add support for showing SELinux context (--context/-Z) 2021-09-10 21:33:34 +02:00
Michael Debertol
8b74562820 cp: correctly copy mode, ownership, acl and context
Fix a mix-up between ownership and mode. The latter (mode / file permissions)
can also be set on windows (which however only affects the read-only flag),
while there doesn't seem to be a straight-forward way to change file ownership
on windows.

Copy the acl as well when copying the mode. This is a non-default feature and can be
enabled with --features feat_acl, because it doesn't seem to work on CI.
It is only available for unix so far.

Copy the SELinux context if possible.
2021-09-01 00:16:22 +02:00
Sylvestre Ledru
b0becf0054
Merge pull request #2410 from hbina/hbina-touch-add-as-common-build
Add touch as a common core utility
2021-08-28 12:39:20 +02:00
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
Hanif Bin Ariffin
d1d57a41fe Add touch as a common core utility
Found out that touch wasn't compiled in what I assume in ordinary Ubuntu
Linux setup.

```
                          ./+o+-       hbina@komputa
                  yyyyy- -yyyyyy+      OS: Ubuntu 20.04 focal
               ://+//////-yyyyyyo      Kernel: x86_64 Linux 5.12.9-051209-generic
           .++ .:/++++++/-.+sss/`      Uptime: 1h 5m
         .:++o:  /++++++++/:--:/-      Packages: 2241
        o:+o+:++.`..```.-/oo+++++/     Shell: bash 5.0.17
       .:+o:+o/.          `+sssoo+/    Resolution: 1920x1080
  .++/+:+oo+o:`             /sssooo.   DE: GNOME 3.36.5
 /+++//+:`oo+o               /::--:.   WM: Mutter
 \+/+o+++`o++o               ++////.   WM Theme: Adwaita
  .++.o+++oo+:`             /dddhhh.   GTK Theme: Yaru [GTK2/3]
       .+.o+oo:.          `oddhhhh+    Icon Theme: ubuntu-mono-dark
        \+.++o+o``-````.:ohdhhhhh+     Font: Cantarell 11
         `:o+++ `ohhhhhhhhyo++os:      Disk: 142G / 475G (32%)
           .o:`.syhhhhhhh/.oo++o`      CPU: AMD Ryzen 7 4800U with Radeon Graphics @ 16x 1.8GHz
               /osyyyyyyo++ooo+++/     GPU: AMD/ATI
                   ````` +oo+++o\:     RAM: 9370MiB / 31584MiB
                          `oo++.

```

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-06-13 08:15:52 +08: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