Commit graph

196 commits

Author SHA1 Message Date
Alex Lyon
5431e947bc
uucore: process: fix exit status processing (#1743)
* uucore: process: fix exit status processing

* tests: timeout: check whether subcommand exit codes are returned
2021-02-23 10:21:01 +01:00
Alex Lyon
c8977a78a4
uucore: fix potential use-after-free in utmpx iterator (#1737) 2021-02-19 08:38:57 +01:00
Sylvestre Ledru
87428b9c32 update uucore to 0.0.6 2021-02-01 23:53:17 +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
Sylvestre Ledru
7942a64231 Remove 'extern crate'
Not necessary anymore. See:
https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html#no-more-extern-crate
2020-12-31 15:44:00 +01:00
Sylvestre Ledru
718695d541 fix(install) - Install was failing with '-m 0333'
The parse_numeric was getting ' 0333' as input
and showing 'mode is too large ( 0333 > 7777) as error

Syntax used: https://sources.debian.org/src/firebird3.0/3.0.7.33374.ds4-1/debian/functions.sh/?hl=145#L145
2020-12-18 13:36:55 +01:00
Sylvestre Ledru
f287309b72 perms: add some docs 2020-12-12 14:43:56 +01:00
Sylvestre Ledru
dca1f28085 install: various improvements in output & tests 2020-12-12 14:36:23 +01:00
Sylvestre Ledru
3024ade071 refactor(chgrp, install): Show the error in the program instead of the lib 2020-12-12 14:28:50 +01:00
Sylvestre Ledru
55c660b986 feature(install): move chown functions into uucore and have install owner support use it 2020-12-12 14:27:59 +01:00
Sylvestre Ledru
763de90fda refactor(chgrp): move chgrp perms function into the uucore to reuse it into install
Will move chown later
2020-12-12 14:26:32 +01:00
Roy Ivy III
688db0d4a2 refactor/uucore ~ revise 'Cargo.toml' towards repo norms 2020-11-08 20:53:18 -06:00
Roy Ivy III
2b4b31a9ee uucore/refactor ~ fix cargo clippy complaints (*allow* temporary_cstring_as_ptr; added FixME note)
* otherwise, unsure how to fix this; the following change

```rust
let res = unsafe { utmpxname(CString::new(f).unwrap().as_ptr()) };
```

to

```rust
let string_ptr = CString::new(f).unwrap().as_ptr();
let res = unsafe { utmpxname(string_ptr) };
```

causes three `who` tests (test_who::test_all, test_who::test_boot, and test_who::test_login)
to fail by generating no output.
2020-11-08 20:53:18 -06:00
Roy Ivy III
3dc9f76c7f uucore/refactor ~ fix cargo clippy complaints (*allow* type_complexity) 2020-11-08 20:53:18 -06:00
Roy Ivy III
66dfd73ffe uucore/refactor ~ fix cargo clippy complaints (iter_nth_zero) 2020-11-08 20:53:18 -06:00
Roy Ivy III
9473abf3ba uucore/polish ~ fix cargo clippy complaints (missing_safety_doc; with ToDO for safety note) 2020-11-08 20:53:18 -06:00
Roy Ivy III
3941d3f18c uucore/refactor ~ fix cargo clippy complaints (len_zero) 2020-11-08 20:53:18 -06:00
Roy Ivy III
bc1084a9f5 uucore/refactor ~ fix cargo clippy complaints (or_fun_call) 2020-11-08 20:53:18 -06:00
Roy Ivy III
c17307c757 fix ~ update workspace pointers to 'uucore' and 'uucore_procs' 2020-11-08 20:26:46 -06:00
Roy Ivy III
aed6f296cf change ~ prepare 'uucore' for grafting/re-merge into 'coreutils' 2020-11-08 19:57:28 -06:00
Alex Lyon
46e2c14f07 Formatting 2020-11-08 19:56:57 -06:00
Alex Lyon
e8dcca1872 Use OsString for arguments rather than String 2020-11-08 19:56:57 -06:00
Sylvestre Ledru
121ab6d847 build/deps ~ relax/update the wild dep
Co-authored-by: Roy Ivy III <rivy.dev@gmail.com>
2020-11-08 19:56:57 -06:00
Roy Ivy III
00779a1fb5 refactor macro variable names (fixes spell-checker/unknown word warnings) 2020-11-08 19:56:57 -06:00
Roy Ivy III
7aa0c92cf8 docs/spell ~ configure VSCode cSpell 2020-11-08 19:56:57 -06:00
Roy Ivy III
d52fb5c484 docs/spell ~ spell-check and addition of exceptions 2020-11-08 19:56:57 -06:00
Roy Ivy III
88e5631fa4 docs/polish ~ polish/update commentary and copyrights 2020-11-08 19:56:57 -06:00
Roy Ivy III
70871edac9 docs/polish ~ remove outdated commentary 2020-11-08 19:56:57 -06:00
Roy Ivy III
b9642a0253 0.0.4 2020-11-08 19:56:57 -06:00
Roy Ivy III
16d367a418 fix 'edition=2018' module import errors 2020-11-08 19:56:56 -06:00
Roy Ivy III
c57a933412 change ~ use crate configuration 'edition=2018' 2020-11-08 19:56:56 -06:00
Roy Ivy III
2f840eedef docs ~ update meta information 2020-11-08 19:56:56 -06:00
Roy Ivy III
fc6370e160 change/API! ~ new_coreopts!() => app!() 2020-11-08 19:56:56 -06:00
Roy Ivy III
0c4d314544 change/API! ~ disp_err!() => show_usage_error!() 2020-11-08 19:56:56 -06:00
Roy Ivy III
d6b1052f3f 0.0.3 2020-11-08 19:56:56 -06:00
Roy Ivy III
1013b760c4 fix cargo clippy warning (no_effect) 2020-11-08 19:56:56 -06:00
Roy Ivy III
b8c22496bb change/uucore_procs ~ add work-around for attribute/macro name collision during testing
- proc_macro "main" collides with attribute "#[main]" during testing (for rust < v1.38.0; fixed in v1.38.0+)
- ref: GH:rust-lang/rust#62127
2020-11-08 19:56:56 -06:00
Roy Ivy III
e35bd4b79c update deps (Cargo.toml); MinSRV == v1.31.0 2020-11-08 19:56:56 -06:00
Roy Ivy III
18b13ed4b4 build/uucore_procs ~ fix proc_dbg!() for MinSRV of v1.31.0 2020-11-08 19:56:56 -06:00
Roy Ivy III
14df9d2df3 docs/build ~ polish crate meta-information (uucore_procs) 2020-11-08 19:56:56 -06:00
Roy Ivy III
246e4427e4 docs/build ~ polish descriptions and crate meta-information in Cargo.toml 2020-11-08 19:56:56 -06:00
Roy Ivy III
ad30781c0c build/uucore_procs ~ add debugging statements 2020-11-08 19:56:56 -06:00
Roy Ivy III
a352657e1f build/uucore_procs ~ add/improve debug infrastructure
- add proc_dbg! macro
- use debug feature to trigger debug traits for the syn crate
2020-11-08 19:56:56 -06:00
Roy Ivy III
cf2fcd8dc1 docs/uucore_macros ~ improve commentary/documentation 2020-11-08 19:56:56 -06:00
Roy Ivy III
c32ff9e8bb change ~ use updated SIGPIPE in procs 2020-11-08 19:56:56 -06:00
Roy Ivy III
0432063479 change ~ add proc-macros module (uucore_procs) with uucore_procs::main()
- `uucore_procs::main!(UUTIL_NAME)` allows simple, consistent instantiation of `main()` for uutils
2020-11-08 19:56:55 -06:00
Roy Ivy III
503cc53014 change ~ improve naming and documentation of default SIGPIPE handling 2020-11-08 19:56:55 -06:00
Roy Ivy III
b0d02e7f43 change ~ reorganize code layout/structure 2020-11-08 19:56:55 -06:00
Roy Ivy III
6a8a677e8b refactor/polish ~ cargo fmt 2020-11-08 19:56:55 -06:00
Roy Ivy III
099b0a2074 0.0.2 2020-11-08 19:56:55 -06:00
Roy Ivy III
5b2c2bdfca maint/CICD ~ fix FreeBSD build on Cirrus CI 2020-11-08 19:56:55 -06:00
Roy Ivy III
16157f57eb maint/build ~ refactor (reorganize) and improve comments within 'Cargo.toml' 2020-11-08 19:56:55 -06:00
Roy Ivy III
ceee0ec09e fix build failure caused by imprecise libc version specification
- more precisely describe permissable libc versions

.# [why]

- libc >= v0.2.15 is needed for utmp support.
- libc <= v0.2.66 is required to avoid build errors for MinSRV == 1.31.0.

Intermittant build failures were being caused by `cargo` using early libc versions.
2020-11-08 19:56:55 -06:00
Roy Ivy III
c08674da28 fix build failure caused by data-encoding v2.2.0
- hold data-encoding to known working "<= 2.1.2"

.# [why]

data-encoding v2.2.0 causes a build error for '1.31.0-i686-pc-windows-msvc'.

```
cargo +1.31.0-i686-pc-windows-msvc build --target=i686-pc-windows-msvc --all-features
...
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)
   --> C:\Users\appveyor\.cargo\registry\src\github.com-1ecc6299db9ec823\data-encoding-2.2.0\src\lib.rs:194:5
    |
187 | / mod prelude {
188 | |     pub use std::borrow::Cow;
189 | | }
    | |_- not an extern crate passed with `--extern`
...
194 |   use prelude::*;
    |       ^^^^^^^
    |
...
```
2020-11-08 19:56:55 -06:00
Roy Ivy III
96a92b3533 refactor ~ pin all crate versions < v1.0.0
. #[why]

Technically, by semver rules, projects with versions < v1.0.0 may make breaking
changes with *any* version change. So, for some protection, pin all crates with
version < v1.0.0 to a specific version.

* ref: <https://semver.org> @@ <https://archive.is/LTGHB>
2020-11-08 19:56:55 -06:00
Roy Ivy III
84d8473e1a fix forced MinSRV increase (using pinned 'backtrace' version)
- hotfix transitive bug in 'failure' forcing MinSRV increase to rust v1.33.0 by pinning 'backtrace' to <= 0.3.31
- [rustlang/nursery#340](https://github.com/rust-lang-nursery/failure/issues/340) is now open on 'failure' to address this issue

.# [why]

'failure' was using 'backtrace' `version = "0.3.3"`, which by semantic version
auto-upgrade was pulling in 'backtrace' > v0.3.30 (specifically, v0.3.40 most
recently). 'backtrace' v0.3.31 introduces use of `#[cfg(target_vendor = ...)]`
which requires rust v1.33.0. So, 'backtrace' is forcing an upgrade of MinSRV
to rust v1.33.0 with the change from backtrace v0.3.30 to backtrace v0.3.31.

Technically, by being less than v1.0.0, 'backtrace' has no semantic version
requirement. And there is debate about whether increasing MinSRV is a semantic
change. But, in my strong opinion, breaking our MinSRV statement is definitely
a semantic change.

* ref: <https://github.com/rust-lang/rust/blob/master/RELEASES.md>
2020-11-08 19:56:55 -06:00
Roy Ivy III
667ed39ece fix uucore::fs for windows
- standardize the return value of `std::env::current_dir()` by using `canonicalize()`

.# [why]

`std::env::current_dir()` will, in some situations on windows hosts, return
"short"-type paths (eg, "C:\Progra~1\..."). Using `canonicalize()` transforms
the path in a standard long form but may also require removing a leading
"\\?\" prefix.
2020-11-08 19:56:55 -06:00
Roy Ivy III
2792d85865 fix ~ 'musl' environment doesn't support utmpx 2020-11-08 19:56:55 -06:00
Alex Lyon
217d83526b Set up for release on crates.io 2020-11-08 19:56:54 -06:00
Alex Lyon
12ce90d9cb Fix doc-test for entries on macOS 2020-11-08 19:56:54 -06:00
Alex Lyon
cdafcce400 Redox is not tested currently, so don't mention it 2020-11-08 19:56:54 -06:00
Alex Lyon
12129d1b1c Separate uucore into its own repository 2020-11-08 19:56:54 -06:00
Alex Lyon
76aef60d80 uucore: allow the Linux zero-copy setup on Android 2020-11-08 19:56:54 -06:00
Alex Lyon
f79f0716ee uucore: remove an inaccurate comment 2020-11-08 19:56:54 -06:00
Alex Lyon
72c322a882 uucore, yes: add zero-copy on supported platforms (only Linux currently) 2020-11-08 19:56:54 -06:00
Alex Lyon
d81d3e3c71 Get rid of all warnings on Linux (or at least WSL) 2020-11-08 19:56:54 -06:00
Zachary Dremann
77cc8d39c6 Replace starts_with and slice with trim_left_matches 2020-11-08 19:56:54 -06:00
Zachary Dremann
c15b18bf5b Don't allocate in signal_by_name_or_value 2020-11-08 19:56:54 -06:00
Zachary Dremann
30df2210f0 Fix is_signal 2020-11-08 19:56:54 -06:00
Zachary Dremann
44550ee5b6 Add tests for signals (including failing test for is_signal 2020-11-08 19:56:54 -06:00
Alex Lyon
4e0025cb17 base32, base64, uucore: merge base32/base64 code 2020-11-08 19:56:54 -06:00
Roy Ivy III
6600993c3e fix: gate unix-only macros (silences "unused" warnings) 2020-11-08 19:56:53 -06:00
Vinzent Steinberg
5f582c05e1 Remove utf8 feature
All code it provides can be implemented with `std`.
2020-11-08 19:56:53 -06:00
Vinzent Steinberg
5160f47a9f Fix more clippy warnings and remove redundant 'static 2020-11-08 19:56:53 -06:00
Vinzent Steinberg
de7a6b5afa Fix a few clippy warnings 2020-11-08 19:56:53 -06:00
Roy Ivy III
bd450ebb94 uucore: fix: use updated 'wild' crate for globbing 2020-11-08 19:56:53 -06:00
Roy Ivy III
9e8b002735 uucore: fix: use forked 'wild' crate with case-sensitivity + API fixes 2020-11-08 19:56:53 -06:00
Roy Ivy III
03d6e733e4 uucore: Add globbing for Windows machines 2020-11-08 19:56:53 -06:00
dependabot[bot]
99da2451ab Bump getopts from 0.2.17 to 0.2.18
Bumps [getopts](https://github.com/rust-lang/getopts) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/rust-lang/getopts/releases)
- [Commits](https://github.com/rust-lang/getopts/compare/0.2.17...v0.2.18)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2020-11-08 19:56:53 -06:00
dependabot[bot]
b21bd0bea3 Bump time from 0.1.39 to 0.1.40
Bumps [time](https://github.com/rust-lang/time) from 0.1.39 to 0.1.40.
- [Release notes](https://github.com/rust-lang/time/releases)
- [Commits](https://github.com/rust-lang/time/compare/0.1.39...0.1.40)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2020-11-08 19:56:53 -06:00
dependabot[bot]
a31b1047c1 Bump libc from 0.2.39 to 0.2.42
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.39 to 0.2.42.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.39...0.2.42)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2020-11-08 19:56:53 -06:00
Alex Lyon
40738bfb0a uucore: update data_encoding and add wrap_write() 2020-11-08 19:56:53 -06:00
Valentin Lorentz
2ad767586b chmod: show human-friendly permissions when --changes or --verbose is used.
Like GNU chmod.
2020-11-08 19:56:53 -06:00
Ian Douglas Scott
eedf7cb28a Make the 'cat' utility build on Redox 2020-11-08 19:56:53 -06:00
Alex Lyon
07de3eda6e uucore: make features opt-in rather than opt-out 2020-11-08 19:56:53 -06:00
Alex Lyon
f74a1b6333 Format everything using rustfmt 2020-11-08 19:56:53 -06:00
Alex Lyon
1c0b1ab375 uucore: remove utsname.rs (and replace with platform-info) 2020-11-08 19:56:53 -06:00
Alex Lyon
ca3393bd86 uucore: read from sys:uname on Redox 2020-11-08 19:56:52 -06:00
Alex Lyon
7559c0d83d cp, tail: update winapi 2020-11-08 19:56:52 -06:00
Alex Lyon
f575b8f4f2 arch: add support for building on Windows 2020-11-08 19:56:52 -06:00
Alex Lyon
3cec199da1 Add Sphinx documentation to generate man pages 2020-11-08 19:56:52 -06:00
Alex Lyon
64c2c2055b chmod, install, uucore: fix build on Windows 2020-11-08 19:56:52 -06:00
Alex Lyon
5544def54e Remove pipe_* macros 2020-11-08 19:56:52 -06:00
Alex Lyon
f0bd170996 chmod, install: move mode parsing into uucore 2020-11-08 19:56:52 -06:00
Alex Lyon
fd555c6d21 Handle SIGPIPE correctly and autogenerate main() for each util 2020-11-08 19:56:52 -06:00
Joshua Miller
6998949c06 pin dependencies 2020-11-08 19:56:52 -06:00
Matt8898
e7940828f9 uucore: add support for optflagmulti and optmulti. 2020-11-08 19:56:52 -06:00
Arcterus
e2b8741a35 uucore: compile on Windows again 2020-11-08 19:56:52 -06:00
Arcterus
f61f30f52b uucore: read symlinked directories correctly in resolve_relative_path() 2020-11-08 19:56:52 -06:00