Commit graph

2013 commits

Author SHA1 Message Date
Michael Gehring
328597334b Merge pull request #743 from jbcrail/refactor-tail
tail: add tests and refactor
2015-12-13 08:17:55 +01:00
Joseph Crail
77abd58be7 Refactor settings into dedicated struct 2015-12-12 18:37:17 -05:00
Joseph Crail
cf399faad2 Add initial tests for default values 2015-12-12 16:24:48 -05:00
Joseph Crail
b6abe56357 Fix whitespace 2015-12-12 15:29:45 -05:00
Heather
f0c8b5b89e Merge pull request #741 from jbcrail/rm-path-shim
Remove trait shim needed before Path stabilized
2015-12-11 08:49:52 +04:00
Joseph Crail
8fa09b2004 Remove trait shim needed before Path stabilized
Now that Path has stabilized in Rust 1.5, I removed the UUPathExt trait
needed to support stable, beta, and nightly.
2015-12-10 14:20:01 -05:00
Michael Gehring
b964014b31 Merge pull request #740 from jbcrail/simplify-build
Refactor and simplify build for utilities
2015-12-08 18:02:05 +01:00
Joseph Crail
58d6add8d1 Add macro to properly find program name. 2015-12-07 21:56:46 -05:00
Joseph Crail
b90d253584 Refactor and simplify build for utilities.
For coreutils, there are two build artifacts:

  1. multicall executable (each utility is a separate static library)
  2. individual utilities (still separate library with main wrapper)

To avoid namespace collision, each utility crate is defined as
"uu_{CMD}". The end user only sees the original utility name. This
simplifies build.rs.

Also, the thin wrapper for the main() function is no longer contained in
the crate. It has been separated into a dedicated file. This was
necessary to work around Cargo's need for the crate name attribute to
match the name in the respective Cargo.toml.
2015-12-07 21:56:45 -05:00
Joseph Crail
d6039c1b22 Remove build for unit tests.
Currently no utility has unit tests, only integration tests.
2015-12-06 22:49:56 -05:00
Heather
ebf58b4c7d Merge pull request #739 from jbcrail/contribute
Move contributing section into separate file
2015-12-03 10:58:45 +04:00
Joseph Crail
be6e835f79 Move contributing section into separate file.
GitHub uses CONTRIBUTING.md as the basis for a message to someone
creating a new issue. I made a few changes to modernize the contribution
section, but there's still room for updates.
2015-12-03 00:21:05 -05:00
Heather
c0251d8f19 Merge pull request #737 from jbcrail/more-windows-fixes
Fix build errors on Windows.
2015-12-01 11:16:05 +04:00
Joseph Crail
2c8ebb6215 Mark chmod as Unix-only until better Win support. 2015-12-01 01:33:38 -05:00
Joseph Crail
cbce549de7 More import fixes for Windows. 2015-12-01 01:27:20 -05:00
Joseph Crail
e8aa7241fa Fix errors with bools represented as ints. 2015-12-01 01:27:08 -05:00
Heather
614044cff0 Merge pull request #736 from jbcrail/refactor-interactive
Refactor check for standard stream interactivity.
2015-11-30 08:39:18 +04:00
Heather
b18c558d6c Merge pull request #735 from jbcrail/update-windows
Update Windows support.
2015-11-30 08:38:32 +04:00
Joseph Crail
9a4c1aa7fa Refactor check for standard stream interactivity.
Since several utilities check if the standard streams are interactive, I
moved this into the uucore::fs library as is_std*_interactive(). I also
added Windows support for these methods, which only return false (or at
least until someone finds a way to support this).
2015-11-29 21:03:53 -05:00
Joseph Crail
1c7da36f76 Remove unused imports and macro attribute. 2015-11-29 20:23:01 -05:00
Joseph Crail
a8bb7f4417 build: create group features for target systems
This allows a user to create builds with or without the Unix-specific
utilities. Right now the Makefile handles this, but this is needed to
migrate away from make.

To build Unix-specific utilities (default):

cargo build
(or)
cargo build --features unix --no-default-features

To build without the Unix-specific utilities:

cargo build --features generic --no-default-features
2015-11-29 17:27:54 -05:00
Joseph Crail
b46050460e uucore: specify a few modules to be Unix-only 2015-11-29 17:27:43 -05:00
Heather
efdaf9a5e5 Merge pull request #734 from ebfe/fix-comm
comm: fix EOF detection
2015-11-29 00:37:50 +04:00
Michael Gehring
2f4ae615ed comm: add basic tests 2015-11-28 20:51:11 +01:00
Michael Gehring
8a6768e9bd comm: clear buffers between read_line calls 2015-11-28 20:35:43 +01:00
Michael Gehring
14b1313eaf comm: fix EOF detection 2015-11-28 20:25:16 +01:00
Heather
0d8b6cb73c Merge pull request #733 from jbcrail/off-by-one-error
cut: fix off-by-one error for range calculation
2015-11-28 10:23:08 +04:00
Joseph Crail
e3eb633ac9 cut: fix off-by-one error for range calculation
When determining the range from which to select portions of a line, the
upper limit of the range is a usize. The maximum upper value is
usize::MAX, but at one point this value is incremented, causing an
overflow. By setting the maximum upper value to usize::MAX-1, the bug is
averted. Since the upper limit of the range is an index (thus, ranging
from 0 to 2^64-1 for 64-bit platforms), the maximum usize should not be
reached.
2015-11-28 00:42:35 -05:00
Joseph Crail
bdf891c630 Merge pull request #732 from ebfe/travis-cargo
travis: switch to cargo build/test
2015-11-27 17:41:12 -05:00
Joseph Crail
2e4b741dd8 Merge pull request #731 from ebfe/fix-warnings
Remove deprecated lint
2015-11-27 17:40:10 -05:00
Michael Gehring
58f89454c7 travis: switch to cargo build/test 2015-11-27 22:25:16 +01:00
Michael Gehring
a773db7325 Remove deprecated lint 2015-11-27 22:23:06 +01:00
Michael Gehring
c60707f5e6 Merge pull request #730 from jbcrail/test-fail
test: fix namespace and broken test
2015-11-27 22:01:45 +01:00
Joseph Crail
012414c49f test: fix namespace and broken test
I separated test's main() into a separate file to override Cargo's
requirement for matching crate names. I had to update the build command
to use a special extern reference for test.

Fixes issues caused by #728.
2015-11-27 15:35:20 -05:00
Joseph Crail
b469b2e316 Merge pull request #729 from ebfe/fix-true
Fix true
2015-11-27 15:34:16 -05:00
Michael Gehring
b1405588ce Fix multicall true 2015-11-27 11:14:25 +01:00
Michael Gehring
282df37a02 Merge pull request #728 from jbcrail/fix-namespace-collision
Fix namespace collision for test.
2015-11-27 10:07:33 +01:00
Joseph Crail
d4e0ea41a3 Fix namespace collision for test.
To avoid linking issues with Rust's libtest, the crate for the test
utility was changed to 'uutest'. However, the user doesn't need to see
this so a few hoops were jumped through to make this transparent.

I also updated the make rules to build the individual features first and
then uutils. This makes 'make && make test' look more organized.
2015-11-27 01:54:18 -05:00
Michael Gehring
cfadcfaf64 Merge pull request #727 from jbcrail/make-cleanup
make: fix build error and remove unused aliases
2015-11-27 03:56:25 +01:00
Joseph Crail
7ef6bdbe81 Compile only against needed dependencies. 2015-11-26 17:51:31 -05:00
Joseph Crail
927049548c Clean up whitespace and remove unused aliases. 2015-11-26 17:13:41 -05:00
Joseph Crail
340ad317e1 Remove syntax error from build. 2015-11-26 17:02:55 -05:00
Michael Gehring
3a591bfe2c Merge pull request #726 from jbcrail/fix-make
Fix make to fail on first build and/or test errors.
2015-11-26 07:56:24 +01:00
Joseph Crail
2d41e6641c Set build/test make rules to be fail fast. 2015-11-25 17:33:07 -05:00
Joseph Crail
089d15c4ca Remove non-fail-fast build and test rules. 2015-11-25 17:32:02 -05:00
Heather
cda60eb3d5 Merge pull request #725 from ebfe/versions
Switch to cargo version numbers
2015-11-25 14:21:16 +04:00
Michael Gehring
ca16e66a55 switch to cargo version numbers 2015-11-25 10:58:49 +01:00
Michael Gehring
9365e100d9 Merge pull request #723 from jbcrail/cleanup
Fix whitespace, unused file, and warnings.
2015-11-25 10:20:46 +01:00
Heather
196254be3b Merge pull request #722 from ebfe/fix-sum
sum: fix tests
2015-11-25 01:18:34 -08:00
Joseph Crail
55e5327573 Use name/version when showing hostname's usage. 2015-11-25 04:05:12 -05:00