diff --git a/Cargo.lock b/Cargo.lock index f28152b96..cf8bd4348 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ dependencies = [ "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "readlink 0.0.1", "realpath 0.0.1", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "relpath 0.0.1", "rm 0.0.1", "rmdir 0.0.1", @@ -114,14 +114,6 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "aho-corasick" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "aho-corasick" version = "0.6.3" @@ -220,6 +212,11 @@ dependencies = [ "uucore 0.0.1", ] +[[package]] +name = "cc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cfg-if" version = "0.1.2" @@ -253,7 +250,7 @@ dependencies = [ [[package]] name = "chrono" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -292,6 +289,14 @@ dependencies = [ "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cmake" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "comm" version = "0.0.1" @@ -306,11 +311,16 @@ name = "cp" version = "0.0.1" dependencies = [ "clap 2.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "ioctl-sys 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "uucore 0.0.1", "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "xattr 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -329,7 +339,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "date" version = "0.0.1" dependencies = [ - "chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.25.0 (registry+https://github.com/rust-lang/crates.io-index)", "uucore 0.0.1", ] @@ -392,6 +402,7 @@ name = "expr" version = "0.0.1" dependencies = [ "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "onig 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "uucore 0.0.1", ] @@ -469,7 +480,7 @@ version = "0.0.1" dependencies = [ "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -516,6 +527,11 @@ dependencies = [ "uucore 0.0.1", ] +[[package]] +name = "ioctl-sys" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "itertools" version = "0.6.0" @@ -594,14 +610,6 @@ dependencies = [ "uucore 0.0.1", ] -[[package]] -name = "memchr" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "memchr" version = "1.0.1" @@ -767,6 +775,27 @@ dependencies = [ "uucore 0.0.1", ] +[[package]] +name = "onig" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "onig_sys 65.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "onig_sys" +version = "65.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cmake 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "paste" version = "0.0.1" @@ -791,6 +820,11 @@ dependencies = [ "uucore 0.0.1", ] +[[package]] +name = "pkg-config" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "pretty-bytes" version = "0.2.1" @@ -824,7 +858,7 @@ dependencies = [ "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "uucore 0.0.1", ] @@ -872,18 +906,6 @@ name = "redox_syscall" version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "regex" -version = "0.1.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "regex" version = "0.2.2" @@ -896,11 +918,6 @@ dependencies = [ "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "regex-syntax" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "regex-syntax" version = "0.4.1" @@ -1183,23 +1200,6 @@ dependencies = [ "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "thread-id" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "thread_local" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "thread_local" version = "0.3.4" @@ -1360,11 +1360,6 @@ dependencies = [ "uucore 0.0.1", ] -[[package]] -name = "utf8-ranges" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "utf8-ranges" version = "1.0.0" @@ -1449,6 +1444,14 @@ name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "xattr" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "yes" version = "0.0.1" @@ -1459,7 +1462,6 @@ dependencies = [ [metadata] "checksum advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e06588080cb19d0acb6739808aafa5f26bfb2ca015b2b6370028b44cf7cb8a9a" -"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" "checksum atty 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0fd4c0631f06448cc45a6bbb3b710ebb7ff8ccb96a0800c994afe23a70d5df2" @@ -1469,9 +1471,11 @@ dependencies = [ "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d" +"checksum cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7db2f146208d7e0fbee761b09cd65a7f51ccc38705d4e7262dad4d73b12a76b1" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" -"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" +"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" "checksum clap 2.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "867a885995b4184be051b70a592d4d70e32d7a188db6e8dff626af286a962771" +"checksum cmake 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "357c07e7a1fc95732793c1edb5901e1a1f305cfcf63a90eb12dbd22bdb6b789d" "checksum data-encoding 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d867ddbf09de0b73e09ec798972fb7f870495a0893f6f736c1855448c5a56789" "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" "checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922" @@ -1480,12 +1484,12 @@ dependencies = [ "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63d68db75012a85555434ee079e7e6337931f87a087ab2988becbadf64673a7f" +"checksum ioctl-sys 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5e2c4b26352496eaaa8ca7cfa9bd99e93419d3f7983dc6e99c2a35fe9e33504a" "checksum itertools 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "772a0928a97246167d59a2a4729df5871f1327ab8b36fd24c4224b229cb47b99" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" "checksum libc 0.2.26 (git+https://github.com/rust-lang/libc.git)" = "" "checksum libc 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "30885bcb161cf67054244d10d4a7f4835ffd58773bc72e07d35fecf472295503" -"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum nix 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "47e49f6982987135c5e9620ab317623e723bd06738fd85377e8d55f57c8b6487" "checksum num 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "a311b77ebdc5dd4cf6449d81e4135d9f0e3b153839ac90e648a8ef538f923525" @@ -1493,13 +1497,14 @@ dependencies = [ "checksum num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "7485fcc84f85b4ecd0ea527b14189281cf27d60e583ae65ebc9c088b13dffe01" "checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0" "checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" +"checksum onig 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1271a3f93197303deda8aedcd96ed2dbb908f61c0954ae70bf7a42f536dc35d7" +"checksum onig_sys 65.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fbdee58fb75f5b7749ebc8f601f570961eed595dfe4c2bb9a542e2f7ae20b946" +"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" "checksum pretty-bytes 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3095b93999fae14b4e0bb661c53875a441d9058b7b1a7ba2dfebc104d3776349" "checksum quick-error 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c36987d4978eb1be2e422b1e0423a557923a5c3e7e6f31d5699e9aafaefa469" "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" "checksum redox_syscall 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "9df6a71a1e67be2104410736b2389fb8e383c1d7e9e792d629ff13c02867147a" -"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" "checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" -"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" "checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" "checksum remove_dir_all 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0882bc41b0ba6131c7f0ce97233b62d8099e3f3abc60d4938185d3e35439c0cc" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" @@ -1516,8 +1521,6 @@ dependencies = [ "checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209" "checksum termsize 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3a225cb94c3630aabd2e289cad545679dd38b5f4891524e92da1be10aae6e4e8" "checksum textwrap 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f86300c3e7416ee233abd7cda890c492007a3980f941f79185c753a701257167" -"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" -"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" "checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" "checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520" "checksum unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18127285758f0e2c6cf325bb3f3d138a12fee27de4f23e146cd6a179f26c2cf3" @@ -1525,7 +1528,6 @@ dependencies = [ "checksum unindent 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3508be0ce1bacc38d579b69bffb4b8d469f5af0c388ff4890b2b294e61671ffe" "checksum unix_socket 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6aa2700417c405c38f5e6902d699345241c28c0b7ade4abaad71e35a87eb1564" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" @@ -1534,3 +1536,4 @@ dependencies = [ "checksum walker 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0488b82b198ac3588ba688f5e56cbd53e0b6dad64f075e67c15647e54aac610" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum xattr 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "abb373b92de38a4301d66bec009929b4fb83120ea1c4a401be89dbe0b9777443" diff --git a/Cargo.toml b/Cargo.toml index 2c8043944..e81ad29d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -241,7 +241,7 @@ yes = { optional=true, path="src/yes" } time = "0.1.38" filetime = "0.1.10" libc = "0.2.26" -regex = "0.1.80" +regex = "0.2.2" rand = "0.3.15" tempdir = "0.3.5" unindent = "0.1.0" diff --git a/README.md b/README.md index 43ab6f8b1..59c72ff24 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ Utilities | Done | Semi-Done | To Do | |-----------|-----------|--------| | arch | cp | chcon | -| base32 | expr (no regular expressions) | csplit | +| base32 | expr | csplit | | base64 | install | dd | | basename | ls | df | | cat | more | join | diff --git a/appveyor.yml b/appveyor.yml index b3797754f..8a5e0d37f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,15 @@ +os: Visual Studio 2015 + environment: matrix: - TARGET: x86_64-pc-windows-msvc + MSYS_BITS: 64 + TOOLCHAIN: msvc + PLATFORM: x86_64 - TARGET: i686-pc-windows-msvc + MSYS_BITS: 32 + TOOLCHAIN: msvc + PLATFORM: i686 - TARGET: i686-pc-windows-gnu MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/dwarf/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z/download MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z @@ -33,6 +41,9 @@ install: - rustc -V - cargo -V + - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "i686" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" + - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 + - if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 artifacts: - path: target\debug\uutils.exe diff --git a/src/date/Cargo.toml b/src/date/Cargo.toml index 7a0e6c1bd..613d82895 100644 --- a/src/date/Cargo.toml +++ b/src/date/Cargo.toml @@ -8,7 +8,7 @@ name = "uu_date" path = "date.rs" [dependencies] -chrono = "0.3.0" +chrono = "0.4.0" clap = "2.24.1" uucore = { path="../uucore" } diff --git a/src/date/date.rs b/src/date/date.rs index 92197c23a..369d1eaba 100644 --- a/src/date/date.rs +++ b/src/date/date.rs @@ -15,7 +15,7 @@ extern crate clap; extern crate uucore; use chrono::{DateTime, FixedOffset, Offset, Local}; -use chrono::offset::utc::UTC; +use chrono::offset::Utc; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::PathBuf; @@ -123,7 +123,7 @@ pub fn uumain(args: Vec) -> i32 { // Get the current time, either in the local time zone or UTC. let now: DateTime = match settings.utc { true => { - let now = UTC::now(); + let now = Utc::now(); now.with_timezone(&now.offset().fix()) } false => { diff --git a/src/expr/Cargo.toml b/src/expr/Cargo.toml index bcb004801..fea7f8ea4 100644 --- a/src/expr/Cargo.toml +++ b/src/expr/Cargo.toml @@ -9,6 +9,7 @@ path = "expr.rs" [dependencies] libc = "0.2.26" +onig = "1.3.0" uucore = { path="../uucore" } [[bin]] diff --git a/src/expr/expr.rs b/src/expr/expr.rs index 56d87d71b..e97fdae31 100644 --- a/src/expr/expr.rs +++ b/src/expr/expr.rs @@ -11,6 +11,7 @@ #[macro_use] extern crate uucore; +extern crate onig; mod tokens; mod syntax_tree; @@ -95,9 +96,9 @@ separates increasing precedence groups. EXPRESSION may be: 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 + STRING : REGEXP anchored pattern match of REGEXP in STRING - match STRING REGEXP [NOT IMPLEMENTED] same as STRING : REGEXP + match STRING REGEXP same as STRING : REGEXP substr STRING POS LENGTH substring of STRING, POS counted from 1 index STRING CHARS index in STRING where any CHARS is found, or 0 length STRING length of STRING diff --git a/src/expr/syntax_tree.rs b/src/expr/syntax_tree.rs index ef77c0d62..bd7f3002c 100644 --- a/src/expr/syntax_tree.rs +++ b/src/expr/syntax_tree.rs @@ -13,6 +13,7 @@ //! use tokens::{Token}; +use onig::{Regex, Syntax, REGEX_OPTION_NONE}; type TokenStack = Vec<(usize, Token)>; pub type OperandsList = Vec< Box >; @@ -105,6 +106,7 @@ impl ASTNode { ), "|" => infix_operator_or(&operand_values), "&" => infix_operator_and(&operand_values), + ":" | "match" => operator_match(&operand_values), "length" => prefix_operator_length( &operand_values ), "index" => prefix_operator_index( &operand_values ), "substr" => prefix_operator_substr( &operand_values ), @@ -350,6 +352,25 @@ fn infix_operator_and( values: &Vec ) -> Result { } } +fn operator_match(values: &Vec) -> Result { + assert!(values.len() == 2); + let re = match Regex::with_options(&values[1], REGEX_OPTION_NONE, Syntax::grep()) { + Ok(m) => m, + Err(err) => return Err(err.description().to_string()) + }; + if re.captures_len() > 0 { + Ok(match re.captures(&values[0]) { + Some(captures) => captures.at(1).unwrap().to_string(), + None => "".to_string() + }) + } else { + Ok(match re.find(&values[0]) { + Some((start, end)) => (end - start).to_string(), + None => "0".to_string() + }) + } +} + fn prefix_operator_length( values: &Vec ) -> Result { assert!( values.len() == 1 ); Ok( values[0].len().to_string() ) diff --git a/src/hashsum/Cargo.toml b/src/hashsum/Cargo.toml index 83f57a388..f4728dd84 100644 --- a/src/hashsum/Cargo.toml +++ b/src/hashsum/Cargo.toml @@ -10,7 +10,7 @@ path = "hashsum.rs" [dependencies] getopts = "0.2.14" libc = "0.2.26" -regex = "0.1.80" +regex = "0.2.2" regex-syntax = "0.4.1" rust-crypto = "0.2.36" rustc-serialize = "0.3.24" diff --git a/src/hashsum/hashsum.rs b/src/hashsum/hashsum.rs index 042d8aeb4..af47432a6 100644 --- a/src/hashsum/hashsum.rs +++ b/src/hashsum/hashsum.rs @@ -295,12 +295,12 @@ fn hashsum(algoname: &str, mut digest: Box, files: Vec, binary: for (i, line) in buffer.lines().enumerate() { let line = safe_unwrap!(line); let (ck_filename, sum, binary_check) = match gnu_re.captures(&line) { - Some(caps) => (caps.name("fileName").unwrap(), - caps.name("digest").unwrap().to_ascii_lowercase(), - caps.name("binary").unwrap() == "*"), + Some(caps) => (caps.name("fileName").unwrap().as_str(), + caps.name("digest").unwrap().as_str().to_ascii_lowercase(), + caps.name("binary").unwrap().as_str() == "*"), None => match bsd_re.captures(&line) { - Some(caps) => (caps.name("fileName").unwrap(), - caps.name("digest").unwrap().to_ascii_lowercase(), + Some(caps) => (caps.name("fileName").unwrap().as_str(), + caps.name("digest").unwrap().as_str().to_ascii_lowercase(), true), None => { bad_format += 1; diff --git a/src/ptx/Cargo.toml b/src/ptx/Cargo.toml index 57fd9ebb4..29f7c32a4 100644 --- a/src/ptx/Cargo.toml +++ b/src/ptx/Cargo.toml @@ -13,7 +13,7 @@ libc = "0.2.26" aho-corasick = "0.6.3" memchr = "1.0.1" regex-syntax = "0.4.1" -regex = "0.1.80" +regex = "0.2.2" uucore = { path="../uucore" } [[bin]] diff --git a/src/ptx/ptx.rs b/src/ptx/ptx.rs index 1ccf3f2eb..ac9731591 100644 --- a/src/ptx/ptx.rs +++ b/src/ptx/ptx.rs @@ -237,11 +237,12 @@ fn create_word_set(config: &Config, filter: &WordFilter, for line in &lines.0 { // if -r, exclude reference from word set let (ref_beg, ref_end) = match ref_reg.find(line) { - Some(x) => x, - None => (0,0) + Some(x) => (x.start(), x.end()), + None => (0, 0) }; // match words with given regex - for (beg, end) in reg.find_iter(line) { + for mat in reg.find_iter(line) { + let (beg, end) = (mat.start(), mat.end()); if config.input_ref && ((beg, end) == (ref_beg, ref_end)) { continue; } @@ -279,8 +280,8 @@ fn get_reference(config: &Config, word_ref: &WordRef, line: &str) -> } else if config.input_ref { let reg = Regex::new(&config.context_regex).unwrap(); let (beg, end) = match reg.find(line) { - Some(x) => x, - None => (0,0) + Some(x) => (x.start(), x.end()), + None => (0, 0) }; format!("{}", &line[beg .. end]) } else { diff --git a/tests/test_split.rs b/tests/test_split.rs index 5903485e2..cae56b606 100644 --- a/tests/test_split.rs +++ b/tests/test_split.rs @@ -93,7 +93,7 @@ impl RandomFile { fn test_split_default() { let (at, mut ucmd) = at_and_ucmd!(); let name = "split_default"; - let glob = Glob::new(&at, ".", r"x[:alpha:][:alpha:]$"); + let glob = Glob::new(&at, ".", r"x[[:alpha:]][[:alpha:]]$"); RandomFile::new(&at, name).add_lines(2000); ucmd.args(&[name]).succeeds(); assert_eq!(glob.count(), 2); @@ -115,7 +115,7 @@ fn test_split_num_prefixed_chunks_by_bytes() { fn test_split_str_prefixed_chunks_by_bytes() { let (at, mut ucmd) = at_and_ucmd!(); let name = "split_str_prefixed_chunks_by_bytes"; - let glob = Glob::new(&at, ".", r"b[:alpha:][:alpha:]$"); + let glob = Glob::new(&at, ".", r"b[[:alpha:]][[:alpha:]]$"); RandomFile::new(&at, name).add_bytes(10000); ucmd.args(&["-b", "1000", name, "b"]).succeeds(); assert_eq!(glob.count(), 10); @@ -137,7 +137,7 @@ fn test_split_num_prefixed_chunks_by_lines() { fn test_split_str_prefixed_chunks_by_lines() { let (at, mut ucmd) = at_and_ucmd!(); let name = "split_str_prefixed_chunks_by_lines"; - let glob = Glob::new(&at, ".", r"d[:alpha:][:alpha:]$"); + let glob = Glob::new(&at, ".", r"d[[:alpha:]][[:alpha:]]$"); RandomFile::new(&at, name).add_lines(10000); ucmd.args(&["-l", "1000", name, "d"]).succeeds(); assert_eq!(glob.count(), 10);