Commit graph

68 commits

Author SHA1 Message Date
Alexander Batischev 655804cff4 tests/chmod: protect umask with a mutex
`test_chmod_ugoa` and `test_chmod_many_options` both change umask, which
is global state. Since tests run concurrently, this might lead to
a situation where one of the tests changes umask to a value that screws
another test's checks. To prevent this, we introduce a mutex that should
be held by any test that changes umask.

Unfortunately, there's no way to hide umask behind this mutex and
enforce its usage: programmers will have to maintain the discipline
themselves.
2016-12-19 13:14:38 +03:00
Lei Zhang e57f987190 All generic utilities compilable on Fuchsia now. 2016-12-14 23:29:40 -05:00
Lei Zhang a34cd30f54 Enable compilation of ls on Fuchsia.
This updates the dependency of pretty-bytes to v0.2.
2016-12-14 23:29:38 -05:00
Lei Zhang ba244794f0 Enable compilation of more on Fuchisa. 2016-12-08 13:08:17 -05:00
Lei Zhang c2882da2e7 mktemp, nproc, ptx, and uniq compilable on Fuchsia now. 2016-11-30 10:50:47 -05:00
Lei Zhang 546f2855d5 Create a new feature for Fuchsia-enabled utilities. 2016-11-24 18:15:50 -05:00
Will Wykeham b9ddb52630 Make Cargo.toml match the Makefile 2016-11-18 13:58:50 +00:00
Will Wykeham 2ad896a6ca Move 'mv' into generic now it builds properly on Windows 2016-11-18 13:58:49 +00:00
Wim Hueskes a900b42a1f od: refactor: readability of expected output
use multiple lines in source too and use unindent crate to fix spacing
2016-09-01 00:00:52 +02:00
Martin Kysel 23bab3df69 moved more to unix utils, minor review updates 2016-08-23 11:40:09 +01:00
Martin Kysel 7d77b9720d Initial more implementation 2016-08-23 10:45:51 +01:00
Knight 8cba71adb4 chgrp: add entries 2016-08-21 17:04:02 +08:00
Knight 8c6cd72848 who: add entries 2016-08-11 00:19:26 +08:00
Knight a23f1a13e7 Remove useless crates 2016-08-07 01:23:49 +08:00
Knight 7c5416799e base32: add entries 2016-08-06 11:45:03 +08:00
Knight 68631e555f Fix windows build 2016-07-29 20:49:08 +08:00
mpkh da0de488e6 Merge pull request #913 from knight42/pinky
Implement pinky
2016-07-26 13:38:53 +04:00
Knight 50fcfac5d1 pinky: Add entries 2016-07-26 16:44:25 +08:00
Ben Eills e72ec4a5bb Implement skeleton install utility
Add install utility skeleton source, based on
mv, including the getopts setup mirroring
GNU's `man install` documentation.  Also
add a single test and build system code.
2016-07-12 20:56:21 +02:00
mpkh 61cf4e4fba Merge pull request #906 from knight42/chown
Implement chown
2016-07-10 19:01:03 +04:00
Smigle00 35fec95d60 arch: add new utility
Signed-off-by: Smigle00 <smigle00@gmail.com>
2016-07-10 00:48:10 +05:30
Knight 69beb787d1 chown: Add entries 2016-06-22 21:36:50 +08:00
Knight ab17a5e544 stat: Add entries 2016-06-04 13:33:08 +08:00
Joseph Crail 678a05d90f mktemp: add build for all systems 2016-05-22 22:54:39 -04:00
Heather bdc1ca7426 Merge pull request #882 from jbcrail/fix-windows-build
Improve Windows build
2016-05-22 16:02:03 +04:00
ibabushkin d504ae18c9 pathchk implemented (see #841) (#860)
* Added pathchk
2016-05-22 15:59:57 +04:00
Joseph Crail 7ef4bb37a8 tests: consolidate into one crate
The main motivation is to move toward running those tests for a specific
target, that is, if a test won't run on Windows, then we shouldn't build
it. This was previously the default behavior and prevented a successful
run on AppVeyor.

I borrowed this pattern from the tests in the Cargo project.
2016-05-22 03:46:54 -04:00
Heather ca78706246 Merge pull request #875 from knight42/dircolors
Implement dircolors
2016-05-10 22:18:40 +04:00
Knight c9f363d09c Add dircolors 2016-05-11 00:43:51 +08:00
Knight 79478626da add mknod 2016-05-07 15:21:37 +08:00
Jeremiah Peschka 9716862cfe Adding skeleton of ls 2016-03-25 14:00:27 -07:00
Michael Gehring 1183dcd7a1 travis: build/test everything on stable 2016-03-23 13:15:36 +01:00
Nathan Ross e32efaa5a1 allow feature-gated integration tests for unimplemented functionality 2016-02-15 23:48:37 -05:00
Nathan Ross 0892ad3cde printf: add (spare C99 hex floats) 2016-02-15 00:10:30 -05:00
Heather 27c77db122 Merge pull request #795 from ebfe/ptx-stable
ptx: fix build on stable
2016-01-06 19:56:14 +04:00
Michael Gehring 26280d9083 expand, unexpand: fix build on stable 2016-01-06 16:35:33 +01:00
Michael Gehring 9cd7d03eff ptx: fix build on stable 2016-01-06 16:20:59 +01:00
Michael Gehring cac838155e travis: skip unsupported utils on stable/beta builds 2016-01-06 13:56:19 +01:00
Sunrin SHIMURA (keen) 58d1d66d16 [mktemp] implement mktemp 2016-01-03 19:10:47 +09:00
Fort eb6453013e Implement shred 2015-12-29 13:30:05 -08: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 2c8ebb6215 Mark chmod as Unix-only until better Win support. 2015-12-01 01:33:38 -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 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
Joseph Crail ca1074201f Split utility files into separate library.
Everything in src/common has been moved to src/uucore. This is defined
as a Cargo library, instead of directly included. This gives us
flexibility to make the library an external crate in the future.

Fixes #717.
2015-11-24 22:20:27 -05:00
Nathan Ross 502957dc3e use cargo idioms to manage dependency resolution and compilation 2015-11-23 02:04:15 -05:00
Nathan Ross a21c54e2cd rewrite tests for cargo compat, decoupled directory, output handling 2015-11-23 02:04:15 -05:00
Nathan Ross b20b2cca19 update uses of libc 0.1.x and deprecated stdlib uses 2015-11-23 02:04:15 -05:00
Roman Gafiyatullin 092e4d1ed4 Implement expr.
Implemented as follows:

    Usage: expr EXPRESSION
      or:  expr OPTION

          --help     display this help and exit
          --version  output version information and exit

    Print the value of EXPRESSION to standard output.  A blank line below
    separates increasing precedence groups.  EXPRESSION may be:

      ARG1 | ARG2       ARG1 if it is neither null nor 0, otherwise ARG2

      ARG1 & ARG2       ARG1 if neither argument is null or 0, otherwise 0

      ARG1 < ARG2       ARG1 is less than ARG2
      ARG1 <= ARG2      ARG1 is less than or equal to ARG2
      ARG1 = ARG2       ARG1 is equal to ARG2
      ARG1 != ARG2      ARG1 is unequal to ARG2
      ARG1 >= ARG2      ARG1 is greater than or equal to ARG2
      ARG1 > ARG2       ARG1 is greater than ARG2

      ARG1 + ARG2       arithmetic sum of ARG1 and ARG2
      ARG1 - ARG2       arithmetic difference of ARG1 and ARG2

      ARG1 * ARG2       arithmetic product of ARG1 and ARG2
      ARG1 / ARG2       arithmetic quotient of ARG1 divided by ARG2
      ARG1 % ARG2       arithmetic remainder of ARG1 divided by ARG2

      STRING : REGEXP   [NOT IMPLEMENTED] anchored pattern match of REGEXP in STRING

      match STRING REGEXP        [NOT IMPLEMENTED] same as STRING : REGEXP
      substr STRING POS LENGTH   [NOT IMPLEMENTED] substring of STRING, POS counted from 1
      index STRING CHARS         [NOT IMPLEMENTED] index in STRING where any CHARS is found, or 0
      length STRING              [NOT IMPLEMENTED] length of STRING
      + TOKEN                    interpret TOKEN as a string, even if it is a
                                   keyword like 'match' or an operator like '/'

      ( EXPRESSION )             value of EXPRESSION

    Beware that many operators need to be escaped or quoted for shells.
    Comparisons are arithmetic if both ARGs are numbers, else lexicographical.
    Pattern matches return the string matched between \( and \) or null; if
    \( and \) are not used, they return the number of characters matched or 0.

    Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null
    or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred.

    Environment variables:
    	* EXPR_DEBUG_TOKENS=1   dump expression's tokens
    	* EXPR_DEBUG_RPN=1      dump expression represented in reverse polish notation
    	* EXPR_DEBUG_SYA_STEP=1 dump each parser step
    	* EXPR_DEBUG_AST=1      dump expression represented abstract syntax tree
2015-10-09 12:31:25 +03:00
Michael Gehring 9d8abbcb06 Basic Cargo build
Builds the uutils multicall binary containing all utils (except stdbuf)
by default. To only build a subset
    `cargo --no-default-features --features <utils>`
can be used.

Whats missing is building the standalone binaries and a mechanism to
automatically disable the build of unix only utils on windows.
2015-08-28 21:12:30 +02:00