Commit graph

18 commits

Author SHA1 Message Date
Roy Ivy III
f0b0e3b867 change ~ reorganize code files 2020-04-14 13:46:18 -05:00
Roy Ivy III
6a18d7f7be update ~ (maint!) use fixed/patched uucore (v0.0.2); await upgrade upstream
- fixes musl (no-utmpx) build bug
- fixes failing windows real{link,path} tests
2020-04-12 22:39:55 -05:00
Roy Ivy III
b8da0d7a8c maint/docs ~ add license notation to all workspace packages 2020-04-12 16:57:11 -05:00
Roy Ivy III
7e15375d82 refactor ~ clean up main directory (move '{mk,uu}main.rs' into src/#common) 2020-04-11 18:50:12 -05:00
Alex Lyon
b73a664677 Split off uucore into its own repository 2019-05-12 22:42:20 -07:00
Roy Ivy III
e977e29d6a expr: fix ~ update onig/onig_sys dependency (fix windows compilation bugs)
* fixes compile bugs blocking compilation "onig_sys" (required for `expr`) on windows
  - MSVC/VS tools are no longer required to be prepped and available on the PATH (via
    `vsvarsall` or the "VCX command prompt")
  - GNU `gcc` compilation/targets are possible on windows
* restrict onig version to v4.3.2 (or later patches [only]; see discussion)

.# Discussion

onig v4.3.0/v4.3.1 inadvertently introduced a new minimum rust version (requiring
v1.31+; see https://github.com/rust-onig/rust-onig/issues/97). This was repaired with
v4.3.2 (requiring only v1.27.0+), and onig now specifies a rust minimum version that will
stay the same for patches, but may change between minor version increments.
2019-03-13 01:33:50 -05:00
dependabot[bot]
c66dd59489
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>
2018-06-11 17:13:54 +00:00
Alex Lyon
2d798bd601 expr, sync, whoami: update Oniguruma and winapi 2018-03-04 18:07:38 -08:00
Alex Lyon
75f11e9635
Handle SIGPIPE correctly and autogenerate main() for each util 2017-12-08 15:05:07 -08:00
Ian Douglas Scott
1a28a48ca3
Merge branch 'master' into expr-regex 2017-10-01 10:09:06 -07:00
Joshua Miller
e8073d2596 pin dependencies 2017-07-15 15:16:09 -05:00
Alex Lyon
0c3a816148 expr: update onig to compile on Windows 2017-06-29 21:25:40 -07:00
Arcterus
9abc3208d3 expr: implement regular expressions 2017-06-29 20:58:16 -07:00
Lei Zhang
aaa7274b63 Remove unnecessary dependencies of getopts & libc for utilities. 2016-11-17 17:43:31 -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
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
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