diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 215232a87a1..2ab6cd86a7e 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -13,7 +13,7 @@ env: PROJECT_NAME: coreutils PROJECT_DESC: "Core universal (cross-platform) utilities" PROJECT_AUTH: "uutils" - RUST_MIN_SRV: "1.47.0" ## MSRV v1.47.0 + RUST_MIN_SRV: "1.54.0" ## MSRV v1.54.0 # * style job configuration STYLE_FAIL_ON_FAULT: true ## (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis diff --git a/Cargo.lock b/Cargo.lock index d9631b5c5d1..ab792e47fcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -251,6 +251,7 @@ dependencies = [ "atty", "bitflags", "strsim 0.8.0", + "term_size", "textwrap 0.11.0", "unicode-width", "vec_map", @@ -258,9 +259,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1957aa4a5fb388f0a0a73ce7556c5b42025b874e5cdc2c670775e346e97adec0" +checksum = "12e8611f9ae4e068fa3e56931fded356ff745e70987ff76924a6e0ab1c8ef2e3" dependencies = [ "atty", "bitflags", @@ -275,11 +276,11 @@ dependencies = [ [[package]] name = "clap_complete" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a394f7ec0715b42a4e52b294984c27c9a61f77c8d82f7774c5198350be143f19" +checksum = "d044e9db8cd0f68191becdeb5246b7462e4cf0c069b19ae00d1bf3fa9889498d" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", ] [[package]] @@ -314,11 +315,11 @@ dependencies = [ [[package]] name = "coreutils" -version = "0.0.8" +version = "0.0.9" dependencies = [ "atty", "chrono", - "clap 3.0.6", + "clap 3.0.7", "clap_complete", "conv", "filetime", @@ -547,9 +548,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -568,9 +569,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -581,9 +582,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" dependencies = [ "cfg-if 1.0.0", "lazy_static", @@ -758,6 +759,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fastrand" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2" +dependencies = [ + "instant", +] + [[package]] name = "file_diff" version = "1.0.0" @@ -845,9 +855,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1001,9 +1011,9 @@ checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" [[package]] name = "libloading" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ "cfg-if 1.0.0", "winapi 0.3.9", @@ -1065,9 +1075,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d" dependencies = [ "libc", ] @@ -1403,9 +1413,9 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "pretty_assertions" -version = "0.7.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cab0e7c02cf376875e9335e0ba1da535775beb5450d21e1dffca068818ed98b" +checksum = "ec0cfe1b2403f172ba0f234e500906ee0a3e493fb81092dac23ebefe129301cc" dependencies = [ "ansi_term", "ctor", @@ -1590,7 +1600,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", ] [[package]] @@ -1796,9 +1806,18 @@ dependencies = [ [[package]] name = "sha1" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" @@ -1863,9 +1882,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "smawk" @@ -1921,9 +1940,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.84" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb2e6da8ee5eb9a61068762a32fa9619cc591ceb055b3687f4cd4051ec2e06b" +checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" dependencies = [ "proc-macro2", "quote 1.0.14", @@ -1932,13 +1951,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", + "fastrand", "libc", - "rand 0.8.4", "redox_syscall", "remove_dir_all", "winapi 0.3.9", @@ -1953,6 +1972,16 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "term_size" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "termcolor" version = "1.1.2" @@ -2003,6 +2032,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ + "term_size", "unicode-width", ] @@ -2136,9 +2166,9 @@ checksum = "7cf7d77f457ef8dfa11e4cd5933c5ddb5dc52a94664071951219a97710f0a32b" [[package]] name = "uu_arch" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "platform-info", "uucore", "uucore_procs", @@ -2146,17 +2176,18 @@ dependencies = [ [[package]] name = "uu_base32" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_base64" -version = "0.0.8" +version = "0.0.9" dependencies = [ + "clap 2.34.0", "uu_base32", "uucore", "uucore_procs", @@ -2164,18 +2195,18 @@ dependencies = [ [[package]] name = "uu_basename" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_basenc" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uu_base32", "uucore", "uucore_procs", @@ -2183,10 +2214,10 @@ dependencies = [ [[package]] name = "uu_cat" -version = "0.0.8" +version = "0.0.9" dependencies = [ "atty", - "clap 3.0.6", + "clap 3.0.7", "nix 0.23.1", "thiserror", "unix_socket", @@ -2197,9 +2228,9 @@ dependencies = [ [[package]] name = "uu_chcon" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "fts-sys", "libc", "selinux", @@ -2210,18 +2241,18 @@ dependencies = [ [[package]] name = "uu_chgrp" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_chmod" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2230,27 +2261,27 @@ dependencies = [ [[package]] name = "uu_chown" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_chroot" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_cksum" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2258,9 +2289,9 @@ dependencies = [ [[package]] name = "uu_comm" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2268,9 +2299,9 @@ dependencies = [ [[package]] name = "uu_cp" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "exacl", "filetime", "ioctl-sys", @@ -2286,9 +2317,9 @@ dependencies = [ [[package]] name = "uu_csplit" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "regex", "thiserror", "uucore", @@ -2297,11 +2328,11 @@ dependencies = [ [[package]] name = "uu_cut" -version = "0.0.8" +version = "0.0.9" dependencies = [ "atty", "bstr", - "clap 3.0.6", + "clap 3.0.7", "memchr 2.4.1", "uucore", "uucore_procs", @@ -2309,10 +2340,10 @@ dependencies = [ [[package]] name = "uu_date" -version = "0.0.8" +version = "0.0.9" dependencies = [ "chrono", - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2321,10 +2352,10 @@ dependencies = [ [[package]] name = "uu_dd" -version = "0.0.8" +version = "0.0.9" dependencies = [ "byte-unit", - "clap 3.0.6", + "clap 3.0.7", "gcd", "libc", "signal-hook", @@ -2335,9 +2366,9 @@ dependencies = [ [[package]] name = "uu_df" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "number_prefix", "uucore", "uucore_procs", @@ -2345,9 +2376,9 @@ dependencies = [ [[package]] name = "uu_dircolors" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "glob", "uucore", "uucore_procs", @@ -2355,9 +2386,9 @@ dependencies = [ [[package]] name = "uu_dirname" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2365,10 +2396,10 @@ dependencies = [ [[package]] name = "uu_du" -version = "0.0.8" +version = "0.0.9" dependencies = [ "chrono", - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", "winapi 0.3.9", @@ -2376,18 +2407,18 @@ dependencies = [ [[package]] name = "uu_echo" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_env" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "rust-ini", "uucore", @@ -2396,9 +2427,9 @@ dependencies = [ [[package]] name = "uu_expand" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "unicode-width", "uucore", "uucore_procs", @@ -2406,9 +2437,9 @@ dependencies = [ [[package]] name = "uu_expr" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "num-bigint", "num-traits", @@ -2419,9 +2450,9 @@ dependencies = [ [[package]] name = "uu_factor" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "coz", "num-traits", "paste 0.1.18", @@ -2434,18 +2465,18 @@ dependencies = [ [[package]] name = "uu_false" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_fmt" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "unicode-width", "uucore", @@ -2454,28 +2485,28 @@ dependencies = [ [[package]] name = "uu_fold" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_groups" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_hashsum" -version = "0.0.8" +version = "0.0.9" dependencies = [ "blake2b_simd", - "clap 3.0.6", + "clap 3.0.7", "digest", "hex", "libc", @@ -2492,9 +2523,9 @@ dependencies = [ [[package]] name = "uu_head" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "memchr 2.4.1", "uucore", "uucore_procs", @@ -2502,9 +2533,9 @@ dependencies = [ [[package]] name = "uu_hostid" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2512,9 +2543,9 @@ dependencies = [ [[package]] name = "uu_hostname" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "hostname", "libc", "uucore", @@ -2524,9 +2555,9 @@ dependencies = [ [[package]] name = "uu_id" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "selinux", "uucore", "uucore_procs", @@ -2534,9 +2565,9 @@ dependencies = [ [[package]] name = "uu_install" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "file_diff", "filetime", "libc", @@ -2547,18 +2578,18 @@ dependencies = [ [[package]] name = "uu_join" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_kill" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2566,9 +2597,9 @@ dependencies = [ [[package]] name = "uu_link" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2576,9 +2607,9 @@ dependencies = [ [[package]] name = "uu_ln" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2586,9 +2617,9 @@ dependencies = [ [[package]] name = "uu_logname" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2596,11 +2627,11 @@ dependencies = [ [[package]] name = "uu_ls" -version = "0.0.8" +version = "0.0.9" dependencies = [ "atty", "chrono", - "clap 3.0.6", + "clap 3.0.7", "glob", "lazy_static", "lscolors", @@ -2616,9 +2647,9 @@ dependencies = [ [[package]] name = "uu_mkdir" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2626,9 +2657,9 @@ dependencies = [ [[package]] name = "uu_mkfifo" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2636,9 +2667,9 @@ dependencies = [ [[package]] name = "uu_mknod" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2646,9 +2677,9 @@ dependencies = [ [[package]] name = "uu_mktemp" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "rand 0.5.6", "tempfile", "uucore", @@ -2657,10 +2688,10 @@ dependencies = [ [[package]] name = "uu_more" -version = "0.0.8" +version = "0.0.9" dependencies = [ "atty", - "clap 3.0.6", + "clap 3.0.7", "crossterm", "nix 0.23.1", "redox_syscall", @@ -2673,9 +2704,9 @@ dependencies = [ [[package]] name = "uu_mv" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "fs_extra", "uucore", "uucore_procs", @@ -2683,9 +2714,9 @@ dependencies = [ [[package]] name = "uu_nice" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "nix 0.23.1", "uucore", @@ -2694,10 +2725,10 @@ dependencies = [ [[package]] name = "uu_nl" -version = "0.0.8" +version = "0.0.9" dependencies = [ "aho-corasick", - "clap 3.0.6", + "clap 3.0.7", "libc", "memchr 2.4.1", "regex", @@ -2708,10 +2739,10 @@ dependencies = [ [[package]] name = "uu_nohup" -version = "0.0.8" +version = "0.0.9" dependencies = [ "atty", - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2719,9 +2750,9 @@ dependencies = [ [[package]] name = "uu_nproc" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "num_cpus", "uucore", @@ -2730,19 +2761,19 @@ dependencies = [ [[package]] name = "uu_numfmt" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_od" -version = "0.0.8" +version = "0.0.9" dependencies = [ "byteorder", - "clap 3.0.6", + "clap 3.0.7", "half", "libc", "uucore", @@ -2751,18 +2782,18 @@ dependencies = [ [[package]] name = "uu_paste" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_pathchk" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2770,19 +2801,19 @@ dependencies = [ [[package]] name = "uu_pinky" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_pr" -version = "0.0.8" +version = "0.0.9" dependencies = [ "chrono", - "clap 3.0.6", + "clap 3.0.7", "getopts", "itertools 0.10.3", "quick-error 2.0.1", @@ -2793,18 +2824,18 @@ dependencies = [ [[package]] name = "uu_printenv" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_printf" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "itertools 0.8.2", "uucore", "uucore_procs", @@ -2812,10 +2843,10 @@ dependencies = [ [[package]] name = "uu_ptx" -version = "0.0.8" +version = "0.0.9" dependencies = [ "aho-corasick", - "clap 3.0.6", + "clap 3.0.7", "libc", "memchr 2.4.1", "regex", @@ -2826,18 +2857,18 @@ dependencies = [ [[package]] name = "uu_pwd" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_readlink" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2845,27 +2876,27 @@ dependencies = [ [[package]] name = "uu_realpath" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_relpath" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_rm" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "remove_dir_all", "uucore", "uucore_procs", @@ -2875,9 +2906,9 @@ dependencies = [ [[package]] name = "uu_rmdir" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -2885,9 +2916,9 @@ dependencies = [ [[package]] name = "uu_runcon" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "fts-sys", "libc", "selinux", @@ -2898,10 +2929,10 @@ dependencies = [ [[package]] name = "uu_seq" -version = "0.0.8" +version = "0.0.9" dependencies = [ "bigdecimal", - "clap 3.0.6", + "clap 3.0.7", "num-bigint", "num-traits", "uucore", @@ -2910,9 +2941,9 @@ dependencies = [ [[package]] name = "uu_shred" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "rand 0.7.3", "uucore", @@ -2921,9 +2952,9 @@ dependencies = [ [[package]] name = "uu_shuf" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "rand 0.5.6", "uucore", "uucore_procs", @@ -2931,19 +2962,19 @@ dependencies = [ [[package]] name = "uu_sleep" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_sort" -version = "0.0.8" +version = "0.0.9" dependencies = [ "binary-heap-plus", - "clap 3.0.6", + "clap 3.0.7", "compare", "ctrlc", "fnv", @@ -2960,27 +2991,27 @@ dependencies = [ [[package]] name = "uu_split" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_stat" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_stdbuf" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "tempfile", "uu_stdbuf_libstdbuf", "uucore", @@ -2989,7 +3020,7 @@ dependencies = [ [[package]] name = "uu_stdbuf_libstdbuf" -version = "0.0.8" +version = "0.0.9" dependencies = [ "cpp", "cpp_build", @@ -3000,18 +3031,18 @@ dependencies = [ [[package]] name = "uu_sum" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_sync" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -3020,9 +3051,9 @@ dependencies = [ [[package]] name = "uu_tac" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "memchr 2.4.1", "memmap2", "regex", @@ -3032,9 +3063,9 @@ dependencies = [ [[package]] name = "uu_tail" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "nix 0.23.1", "redox_syscall", @@ -3045,9 +3076,9 @@ dependencies = [ [[package]] name = "uu_tee" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "retain_mut", "uucore", @@ -3056,9 +3087,9 @@ dependencies = [ [[package]] name = "uu_test" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "redox_syscall", "uucore", @@ -3067,9 +3098,9 @@ dependencies = [ [[package]] name = "uu_timeout" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "nix 0.23.1", "uucore", @@ -3078,9 +3109,9 @@ dependencies = [ [[package]] name = "uu_touch" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "filetime", "time", "uucore", @@ -3089,10 +3120,10 @@ dependencies = [ [[package]] name = "uu_tr" -version = "0.0.8" +version = "0.0.9" dependencies = [ "bit-set", - "clap 3.0.6", + "clap 3.0.7", "fnv", "uucore", "uucore_procs", @@ -3100,37 +3131,37 @@ dependencies = [ [[package]] name = "uu_true" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_truncate" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_tsort" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_tty" -version = "0.0.8" +version = "0.0.9" dependencies = [ "atty", - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -3138,9 +3169,9 @@ dependencies = [ [[package]] name = "uu_uname" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "platform-info", "uucore", "uucore_procs", @@ -3148,9 +3179,9 @@ dependencies = [ [[package]] name = "uu_unexpand" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "unicode-width", "uucore", "uucore_procs", @@ -3158,9 +3189,9 @@ dependencies = [ [[package]] name = "uu_uniq" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "strum", "strum_macros", "uucore", @@ -3169,38 +3200,38 @@ dependencies = [ [[package]] name = "uu_unlink" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_uptime" -version = "0.0.8" +version = "0.0.9" dependencies = [ "chrono", - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_users" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_wc" -version = "0.0.8" +version = "0.0.9" dependencies = [ "bytecount", - "clap 3.0.6", + "clap 3.0.7", "libc", "nix 0.23.1", "unicode-width", @@ -3211,18 +3242,18 @@ dependencies = [ [[package]] name = "uu_who" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "uucore", "uucore_procs", ] [[package]] name = "uu_whoami" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "libc", "uucore", "uucore_procs", @@ -3231,9 +3262,9 @@ dependencies = [ [[package]] name = "uu_yes" -version = "0.0.8" +version = "0.0.9" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "nix 0.23.1", "uucore", "uucore_procs", @@ -3241,9 +3272,9 @@ dependencies = [ [[package]] name = "uucore" -version = "0.0.10" +version = "0.0.11" dependencies = [ - "clap 3.0.6", + "clap 3.0.7", "data-encoding", "data-encoding-macro", "dns-lookup", @@ -3265,7 +3296,7 @@ dependencies = [ [[package]] name = "uucore_procs" -version = "0.0.7" +version = "0.0.8" dependencies = [ "proc-macro2", "quote 1.0.14", diff --git a/Cargo.toml b/Cargo.toml index b2fbb426c5b..a099115a6c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "coreutils" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "coreutils ~ GNU coreutils (updated); implemented as universal (cross-platform) utils, written in Rust" @@ -248,110 +248,110 @@ clap = { version = "3.0", features = ["wrap_help", "cargo"] } clap_complete = "3.0" lazy_static = { version="1.3" } textwrap = { version="0.14", features=["terminal_size"] } -uucore = { version=">=0.0.10", package="uucore", path="src/uucore" } +uucore = { version=">=0.0.11", package="uucore", path="src/uucore" } selinux = { version="0.2.3", optional = true } # * uutils -uu_test = { optional=true, version="0.0.8", package="uu_test", path="src/uu/test" } +uu_test = { optional=true, version="0.0.9", package="uu_test", path="src/uu/test" } # -arch = { optional=true, version="0.0.8", package="uu_arch", path="src/uu/arch" } -base32 = { optional=true, version="0.0.8", package="uu_base32", path="src/uu/base32" } -base64 = { optional=true, version="0.0.8", package="uu_base64", path="src/uu/base64" } -basename = { optional=true, version="0.0.8", package="uu_basename", path="src/uu/basename" } -basenc = { optional=true, version="0.0.8", package="uu_basenc", path="src/uu/basenc" } -cat = { optional=true, version="0.0.8", package="uu_cat", path="src/uu/cat" } -chcon = { optional=true, version="0.0.8", package="uu_chcon", path="src/uu/chcon" } -chgrp = { optional=true, version="0.0.8", package="uu_chgrp", path="src/uu/chgrp" } -chmod = { optional=true, version="0.0.8", package="uu_chmod", path="src/uu/chmod" } -chown = { optional=true, version="0.0.8", package="uu_chown", path="src/uu/chown" } -chroot = { optional=true, version="0.0.8", package="uu_chroot", path="src/uu/chroot" } -cksum = { optional=true, version="0.0.8", package="uu_cksum", path="src/uu/cksum" } -comm = { optional=true, version="0.0.8", package="uu_comm", path="src/uu/comm" } -cp = { optional=true, version="0.0.8", package="uu_cp", path="src/uu/cp" } -csplit = { optional=true, version="0.0.8", package="uu_csplit", path="src/uu/csplit" } -cut = { optional=true, version="0.0.8", package="uu_cut", path="src/uu/cut" } -date = { optional=true, version="0.0.8", package="uu_date", path="src/uu/date" } -dd = { optional=true, version="0.0.8", package="uu_dd", path="src/uu/dd" } -df = { optional=true, version="0.0.8", package="uu_df", path="src/uu/df" } -dircolors= { optional=true, version="0.0.8", package="uu_dircolors", path="src/uu/dircolors" } -dirname = { optional=true, version="0.0.8", package="uu_dirname", path="src/uu/dirname" } -du = { optional=true, version="0.0.8", package="uu_du", path="src/uu/du" } -echo = { optional=true, version="0.0.8", package="uu_echo", path="src/uu/echo" } -env = { optional=true, version="0.0.8", package="uu_env", path="src/uu/env" } -expand = { optional=true, version="0.0.8", package="uu_expand", path="src/uu/expand" } -expr = { optional=true, version="0.0.8", package="uu_expr", path="src/uu/expr" } -factor = { optional=true, version="0.0.8", package="uu_factor", path="src/uu/factor" } -false = { optional=true, version="0.0.8", package="uu_false", path="src/uu/false" } -fmt = { optional=true, version="0.0.8", package="uu_fmt", path="src/uu/fmt" } -fold = { optional=true, version="0.0.8", package="uu_fold", path="src/uu/fold" } -groups = { optional=true, version="0.0.8", package="uu_groups", path="src/uu/groups" } -hashsum = { optional=true, version="0.0.8", package="uu_hashsum", path="src/uu/hashsum" } -head = { optional=true, version="0.0.8", package="uu_head", path="src/uu/head" } -hostid = { optional=true, version="0.0.8", package="uu_hostid", path="src/uu/hostid" } -hostname = { optional=true, version="0.0.8", package="uu_hostname", path="src/uu/hostname" } -id = { optional=true, version="0.0.8", package="uu_id", path="src/uu/id" } -install = { optional=true, version="0.0.8", package="uu_install", path="src/uu/install" } -join = { optional=true, version="0.0.8", package="uu_join", path="src/uu/join" } -kill = { optional=true, version="0.0.8", package="uu_kill", path="src/uu/kill" } -link = { optional=true, version="0.0.8", package="uu_link", path="src/uu/link" } -ln = { optional=true, version="0.0.8", package="uu_ln", path="src/uu/ln" } -ls = { optional=true, version="0.0.8", package="uu_ls", path="src/uu/ls" } -logname = { optional=true, version="0.0.8", package="uu_logname", path="src/uu/logname" } -mkdir = { optional=true, version="0.0.8", package="uu_mkdir", path="src/uu/mkdir" } -mkfifo = { optional=true, version="0.0.8", package="uu_mkfifo", path="src/uu/mkfifo" } -mknod = { optional=true, version="0.0.8", package="uu_mknod", path="src/uu/mknod" } -mktemp = { optional=true, version="0.0.8", package="uu_mktemp", path="src/uu/mktemp" } -more = { optional=true, version="0.0.8", package="uu_more", path="src/uu/more" } -mv = { optional=true, version="0.0.8", package="uu_mv", path="src/uu/mv" } -nice = { optional=true, version="0.0.8", package="uu_nice", path="src/uu/nice" } -nl = { optional=true, version="0.0.8", package="uu_nl", path="src/uu/nl" } -nohup = { optional=true, version="0.0.8", package="uu_nohup", path="src/uu/nohup" } -nproc = { optional=true, version="0.0.8", package="uu_nproc", path="src/uu/nproc" } -numfmt = { optional=true, version="0.0.8", package="uu_numfmt", path="src/uu/numfmt" } -od = { optional=true, version="0.0.8", package="uu_od", path="src/uu/od" } -paste = { optional=true, version="0.0.8", package="uu_paste", path="src/uu/paste" } -pathchk = { optional=true, version="0.0.8", package="uu_pathchk", path="src/uu/pathchk" } -pinky = { optional=true, version="0.0.8", package="uu_pinky", path="src/uu/pinky" } -pr = { optional=true, version="0.0.8", package="uu_pr", path="src/uu/pr" } -printenv = { optional=true, version="0.0.8", package="uu_printenv", path="src/uu/printenv" } -printf = { optional=true, version="0.0.8", package="uu_printf", path="src/uu/printf" } -ptx = { optional=true, version="0.0.8", package="uu_ptx", path="src/uu/ptx" } -pwd = { optional=true, version="0.0.8", package="uu_pwd", path="src/uu/pwd" } -readlink = { optional=true, version="0.0.8", package="uu_readlink", path="src/uu/readlink" } -realpath = { optional=true, version="0.0.8", package="uu_realpath", path="src/uu/realpath" } -relpath = { optional=true, version="0.0.8", package="uu_relpath", path="src/uu/relpath" } -rm = { optional=true, version="0.0.8", package="uu_rm", path="src/uu/rm" } -rmdir = { optional=true, version="0.0.8", package="uu_rmdir", path="src/uu/rmdir" } -runcon = { optional=true, version="0.0.8", package="uu_runcon", path="src/uu/runcon" } -seq = { optional=true, version="0.0.8", package="uu_seq", path="src/uu/seq" } -shred = { optional=true, version="0.0.8", package="uu_shred", path="src/uu/shred" } -shuf = { optional=true, version="0.0.8", package="uu_shuf", path="src/uu/shuf" } -sleep = { optional=true, version="0.0.8", package="uu_sleep", path="src/uu/sleep" } -sort = { optional=true, version="0.0.8", package="uu_sort", path="src/uu/sort" } -split = { optional=true, version="0.0.8", package="uu_split", path="src/uu/split" } -stat = { optional=true, version="0.0.8", package="uu_stat", path="src/uu/stat" } -stdbuf = { optional=true, version="0.0.8", package="uu_stdbuf", path="src/uu/stdbuf" } -sum = { optional=true, version="0.0.8", package="uu_sum", path="src/uu/sum" } -sync = { optional=true, version="0.0.8", package="uu_sync", path="src/uu/sync" } -tac = { optional=true, version="0.0.8", package="uu_tac", path="src/uu/tac" } -tail = { optional=true, version="0.0.8", package="uu_tail", path="src/uu/tail" } -tee = { optional=true, version="0.0.8", package="uu_tee", path="src/uu/tee" } -timeout = { optional=true, version="0.0.8", package="uu_timeout", path="src/uu/timeout" } -touch = { optional=true, version="0.0.8", package="uu_touch", path="src/uu/touch" } -tr = { optional=true, version="0.0.8", package="uu_tr", path="src/uu/tr" } -true = { optional=true, version="0.0.8", package="uu_true", path="src/uu/true" } -truncate = { optional=true, version="0.0.8", package="uu_truncate", path="src/uu/truncate" } -tsort = { optional=true, version="0.0.8", package="uu_tsort", path="src/uu/tsort" } -tty = { optional=true, version="0.0.8", package="uu_tty", path="src/uu/tty" } -uname = { optional=true, version="0.0.8", package="uu_uname", path="src/uu/uname" } -unexpand = { optional=true, version="0.0.8", package="uu_unexpand", path="src/uu/unexpand" } -uniq = { optional=true, version="0.0.8", package="uu_uniq", path="src/uu/uniq" } -unlink = { optional=true, version="0.0.8", package="uu_unlink", path="src/uu/unlink" } -uptime = { optional=true, version="0.0.8", package="uu_uptime", path="src/uu/uptime" } -users = { optional=true, version="0.0.8", package="uu_users", path="src/uu/users" } -wc = { optional=true, version="0.0.8", package="uu_wc", path="src/uu/wc" } -who = { optional=true, version="0.0.8", package="uu_who", path="src/uu/who" } -whoami = { optional=true, version="0.0.8", package="uu_whoami", path="src/uu/whoami" } -yes = { optional=true, version="0.0.8", package="uu_yes", path="src/uu/yes" } +arch = { optional=true, version="0.0.9", package="uu_arch", path="src/uu/arch" } +base32 = { optional=true, version="0.0.9", package="uu_base32", path="src/uu/base32" } +base64 = { optional=true, version="0.0.9", package="uu_base64", path="src/uu/base64" } +basename = { optional=true, version="0.0.9", package="uu_basename", path="src/uu/basename" } +basenc = { optional=true, version="0.0.9", package="uu_basenc", path="src/uu/basenc" } +cat = { optional=true, version="0.0.9", package="uu_cat", path="src/uu/cat" } +chcon = { optional=true, version="0.0.9", package="uu_chcon", path="src/uu/chcon" } +chgrp = { optional=true, version="0.0.9", package="uu_chgrp", path="src/uu/chgrp" } +chmod = { optional=true, version="0.0.9", package="uu_chmod", path="src/uu/chmod" } +chown = { optional=true, version="0.0.9", package="uu_chown", path="src/uu/chown" } +chroot = { optional=true, version="0.0.9", package="uu_chroot", path="src/uu/chroot" } +cksum = { optional=true, version="0.0.9", package="uu_cksum", path="src/uu/cksum" } +comm = { optional=true, version="0.0.9", package="uu_comm", path="src/uu/comm" } +cp = { optional=true, version="0.0.9", package="uu_cp", path="src/uu/cp" } +csplit = { optional=true, version="0.0.9", package="uu_csplit", path="src/uu/csplit" } +cut = { optional=true, version="0.0.9", package="uu_cut", path="src/uu/cut" } +date = { optional=true, version="0.0.9", package="uu_date", path="src/uu/date" } +dd = { optional=true, version="0.0.9", package="uu_dd", path="src/uu/dd" } +df = { optional=true, version="0.0.9", package="uu_df", path="src/uu/df" } +dircolors= { optional=true, version="0.0.9", package="uu_dircolors", path="src/uu/dircolors" } +dirname = { optional=true, version="0.0.9", package="uu_dirname", path="src/uu/dirname" } +du = { optional=true, version="0.0.9", package="uu_du", path="src/uu/du" } +echo = { optional=true, version="0.0.9", package="uu_echo", path="src/uu/echo" } +env = { optional=true, version="0.0.9", package="uu_env", path="src/uu/env" } +expand = { optional=true, version="0.0.9", package="uu_expand", path="src/uu/expand" } +expr = { optional=true, version="0.0.9", package="uu_expr", path="src/uu/expr" } +factor = { optional=true, version="0.0.9", package="uu_factor", path="src/uu/factor" } +false = { optional=true, version="0.0.9", package="uu_false", path="src/uu/false" } +fmt = { optional=true, version="0.0.9", package="uu_fmt", path="src/uu/fmt" } +fold = { optional=true, version="0.0.9", package="uu_fold", path="src/uu/fold" } +groups = { optional=true, version="0.0.9", package="uu_groups", path="src/uu/groups" } +hashsum = { optional=true, version="0.0.9", package="uu_hashsum", path="src/uu/hashsum" } +head = { optional=true, version="0.0.9", package="uu_head", path="src/uu/head" } +hostid = { optional=true, version="0.0.9", package="uu_hostid", path="src/uu/hostid" } +hostname = { optional=true, version="0.0.9", package="uu_hostname", path="src/uu/hostname" } +id = { optional=true, version="0.0.9", package="uu_id", path="src/uu/id" } +install = { optional=true, version="0.0.9", package="uu_install", path="src/uu/install" } +join = { optional=true, version="0.0.9", package="uu_join", path="src/uu/join" } +kill = { optional=true, version="0.0.9", package="uu_kill", path="src/uu/kill" } +link = { optional=true, version="0.0.9", package="uu_link", path="src/uu/link" } +ln = { optional=true, version="0.0.9", package="uu_ln", path="src/uu/ln" } +ls = { optional=true, version="0.0.9", package="uu_ls", path="src/uu/ls" } +logname = { optional=true, version="0.0.9", package="uu_logname", path="src/uu/logname" } +mkdir = { optional=true, version="0.0.9", package="uu_mkdir", path="src/uu/mkdir" } +mkfifo = { optional=true, version="0.0.9", package="uu_mkfifo", path="src/uu/mkfifo" } +mknod = { optional=true, version="0.0.9", package="uu_mknod", path="src/uu/mknod" } +mktemp = { optional=true, version="0.0.9", package="uu_mktemp", path="src/uu/mktemp" } +more = { optional=true, version="0.0.9", package="uu_more", path="src/uu/more" } +mv = { optional=true, version="0.0.9", package="uu_mv", path="src/uu/mv" } +nice = { optional=true, version="0.0.9", package="uu_nice", path="src/uu/nice" } +nl = { optional=true, version="0.0.9", package="uu_nl", path="src/uu/nl" } +nohup = { optional=true, version="0.0.9", package="uu_nohup", path="src/uu/nohup" } +nproc = { optional=true, version="0.0.9", package="uu_nproc", path="src/uu/nproc" } +numfmt = { optional=true, version="0.0.9", package="uu_numfmt", path="src/uu/numfmt" } +od = { optional=true, version="0.0.9", package="uu_od", path="src/uu/od" } +paste = { optional=true, version="0.0.9", package="uu_paste", path="src/uu/paste" } +pathchk = { optional=true, version="0.0.9", package="uu_pathchk", path="src/uu/pathchk" } +pinky = { optional=true, version="0.0.9", package="uu_pinky", path="src/uu/pinky" } +pr = { optional=true, version="0.0.9", package="uu_pr", path="src/uu/pr" } +printenv = { optional=true, version="0.0.9", package="uu_printenv", path="src/uu/printenv" } +printf = { optional=true, version="0.0.9", package="uu_printf", path="src/uu/printf" } +ptx = { optional=true, version="0.0.9", package="uu_ptx", path="src/uu/ptx" } +pwd = { optional=true, version="0.0.9", package="uu_pwd", path="src/uu/pwd" } +readlink = { optional=true, version="0.0.9", package="uu_readlink", path="src/uu/readlink" } +realpath = { optional=true, version="0.0.9", package="uu_realpath", path="src/uu/realpath" } +relpath = { optional=true, version="0.0.9", package="uu_relpath", path="src/uu/relpath" } +rm = { optional=true, version="0.0.9", package="uu_rm", path="src/uu/rm" } +rmdir = { optional=true, version="0.0.9", package="uu_rmdir", path="src/uu/rmdir" } +runcon = { optional=true, version="0.0.9", package="uu_runcon", path="src/uu/runcon" } +seq = { optional=true, version="0.0.9", package="uu_seq", path="src/uu/seq" } +shred = { optional=true, version="0.0.9", package="uu_shred", path="src/uu/shred" } +shuf = { optional=true, version="0.0.9", package="uu_shuf", path="src/uu/shuf" } +sleep = { optional=true, version="0.0.9", package="uu_sleep", path="src/uu/sleep" } +sort = { optional=true, version="0.0.9", package="uu_sort", path="src/uu/sort" } +split = { optional=true, version="0.0.9", package="uu_split", path="src/uu/split" } +stat = { optional=true, version="0.0.9", package="uu_stat", path="src/uu/stat" } +stdbuf = { optional=true, version="0.0.9", package="uu_stdbuf", path="src/uu/stdbuf" } +sum = { optional=true, version="0.0.9", package="uu_sum", path="src/uu/sum" } +sync = { optional=true, version="0.0.9", package="uu_sync", path="src/uu/sync" } +tac = { optional=true, version="0.0.9", package="uu_tac", path="src/uu/tac" } +tail = { optional=true, version="0.0.9", package="uu_tail", path="src/uu/tail" } +tee = { optional=true, version="0.0.9", package="uu_tee", path="src/uu/tee" } +timeout = { optional=true, version="0.0.9", package="uu_timeout", path="src/uu/timeout" } +touch = { optional=true, version="0.0.9", package="uu_touch", path="src/uu/touch" } +tr = { optional=true, version="0.0.9", package="uu_tr", path="src/uu/tr" } +true = { optional=true, version="0.0.9", package="uu_true", path="src/uu/true" } +truncate = { optional=true, version="0.0.9", package="uu_truncate", path="src/uu/truncate" } +tsort = { optional=true, version="0.0.9", package="uu_tsort", path="src/uu/tsort" } +tty = { optional=true, version="0.0.9", package="uu_tty", path="src/uu/tty" } +uname = { optional=true, version="0.0.9", package="uu_uname", path="src/uu/uname" } +unexpand = { optional=true, version="0.0.9", package="uu_unexpand", path="src/uu/unexpand" } +uniq = { optional=true, version="0.0.9", package="uu_uniq", path="src/uu/uniq" } +unlink = { optional=true, version="0.0.9", package="uu_unlink", path="src/uu/unlink" } +uptime = { optional=true, version="0.0.9", package="uu_uptime", path="src/uu/uptime" } +users = { optional=true, version="0.0.9", package="uu_users", path="src/uu/users" } +wc = { optional=true, version="0.0.9", package="uu_wc", path="src/uu/wc" } +who = { optional=true, version="0.0.9", package="uu_who", path="src/uu/who" } +whoami = { optional=true, version="0.0.9", package="uu_whoami", path="src/uu/whoami" } +yes = { optional=true, version="0.0.9", package="uu_yes", path="src/uu/yes" } # this breaks clippy linting with: "tests/by-util/test_factor_benches.rs: No such file or directory (os error 2)" # factor_benches = { optional = true, version = "0.0.0", package = "uu_factor_benches", path = "tests/benches/factor" } @@ -362,19 +362,19 @@ yes = { optional=true, version="0.0.8", package="uu_yes", path="src/uu/yes" #pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`) [dev-dependencies] -chrono = "0.4.11" +chrono = "^0.4.11" conv = "0.3" filetime = "0.2" glob = "0.3.0" libc = "0.2" -pretty_assertions = "0.7.2" +pretty_assertions = "1" rand = "0.7" regex = "1.0" sha1 = { version="0.6", features=["std"] } tempfile = "3.2.0" time = "0.1" unindent = "0.1" -uucore = { version=">=0.0.10", package="uucore", path="src/uucore", features=["entries", "process"] } +uucore = { version=">=0.0.11", package="uucore", path="src/uucore", features=["entries", "process"] } walkdir = "2.2" atty = "0.2" diff --git a/GNUmakefile b/GNUmakefile index 367568ca834..12cd950139b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -47,12 +47,12 @@ BUSYBOX_VER := 1.32.1 BUSYBOX_SRC := $(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER) ifeq ($(SELINUX_ENABLED),) - SELINUX_ENABLED := 0 - ifneq ($(OS),Windows_NT) - ifeq ($(shell /sbin/selinuxenabled 2>/dev/null ; echo $$?),0) - SELINUX_ENABLED := 1 - endif - endif + SELINUX_ENABLED := 0 + ifneq ($(OS),Windows_NT) + ifeq ($(shell /sbin/selinuxenabled 2>/dev/null ; echo $$?),0) + SELINUX_ENABLED := 1 + endif + endif endif # Possible programs @@ -161,11 +161,11 @@ SELINUX_PROGS := \ runcon ifneq ($(OS),Windows_NT) - PROGS := $(PROGS) $(UNIX_PROGS) + PROGS := $(PROGS) $(UNIX_PROGS) endif ifeq ($(SELINUX_ENABLED),1) - PROGS := $(PROGS) $(SELINUX_PROGS) + PROGS := $(PROGS) $(SELINUX_PROGS) endif UTILS ?= $(PROGS) diff --git a/README.md b/README.md index 7e420bb333f..306ca08a786 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ to compile anywhere, and this is as good a way as any to try and learn it. ### Rust Version uutils follows Rust's release channels and is tested against stable, beta and nightly. -The current oldest supported version of the Rust compiler is `1.47`. +The current oldest supported version of the Rust compiler is `1.54`. On both Windows and Redox, only the nightly version is tested currently. diff --git a/build.rs b/build.rs index cfe6ce6bc62..ecff0f707cc 100644 --- a/build.rs +++ b/build.rs @@ -83,7 +83,7 @@ pub fn main() { mf.write_all( format!( "\tmap.insert(\"{k}\", ({krate}::uumain, {krate}::uu_app));\n", - k = krate[override_prefix.len()..].to_string(), + k = &krate[override_prefix.len()..], krate = krate ) .as_bytes(), @@ -92,7 +92,7 @@ pub fn main() { tf.write_all( format!( "#[path=\"{dir}/test_{k}.rs\"]\nmod test_{k};\n", - k = krate[override_prefix.len()..].to_string(), + k = &krate[override_prefix.len()..], dir = util_tests_dir, ) .as_bytes(), diff --git a/src/uu/arch/Cargo.toml b/src/uu/arch/Cargo.toml index 7ad72c49377..c268fd1dab8 100644 --- a/src/uu/arch/Cargo.toml +++ b/src/uu/arch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_arch" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "arch ~ (uutils) display machine architecture" @@ -17,8 +17,8 @@ path = "src/arch.rs" [dependencies] platform-info = "0.2" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "arch" diff --git a/src/uu/base32/Cargo.toml b/src/uu/base32/Cargo.toml index 280a4329d62..5569f9a80e2 100644 --- a/src/uu/base32/Cargo.toml +++ b/src/uu/base32/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_base32" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "base32 ~ (uutils) decode/encode input (base32-encoding)" @@ -16,8 +16,8 @@ path = "src/base32.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features = ["encoding"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features = ["encoding"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "base32" diff --git a/src/uu/base64/Cargo.toml b/src/uu/base64/Cargo.toml index ad2b295e826..9f07a7cb60b 100644 --- a/src/uu/base64/Cargo.toml +++ b/src/uu/base64/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_base64" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "base64 ~ (uutils) decode/encode input (base64-encoding)" @@ -15,8 +15,9 @@ edition = "2018" path = "src/base64.rs" [dependencies] -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features = ["encoding"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +clap = { version = "2.33", features = ["wrap_help"] } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features = ["encoding"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } uu_base32 = { version=">=0.0.8", package="uu_base32", path="../base32"} [[bin]] diff --git a/src/uu/basename/Cargo.toml b/src/uu/basename/Cargo.toml index 6096f7b29e1..0cf44c748fd 100644 --- a/src/uu/basename/Cargo.toml +++ b/src/uu/basename/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_basename" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "basename ~ (uutils) display PATHNAME with leading directory components removed" @@ -16,8 +16,8 @@ path = "src/basename.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "basename" diff --git a/src/uu/basenc/Cargo.toml b/src/uu/basenc/Cargo.toml index c0f2b99cc14..c110bdba17f 100644 --- a/src/uu/basenc/Cargo.toml +++ b/src/uu/basenc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_basenc" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "basenc ~ (uutils) decode/encode input" @@ -16,8 +16,8 @@ path = "src/basenc.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features = ["encoding"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features = ["encoding"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } uu_base32 = { version=">=0.0.8", package="uu_base32", path="../base32"} [[bin]] diff --git a/src/uu/cat/Cargo.toml b/src/uu/cat/Cargo.toml index 31d585fec93..ded8aa6883c 100644 --- a/src/uu/cat/Cargo.toml +++ b/src/uu/cat/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_cat" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "cat ~ (uutils) concatenate and display input" @@ -18,8 +18,8 @@ path = "src/cat.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } thiserror = "1.0" atty = "0.2" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs", "pipes"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "pipes"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(unix)'.dependencies] unix_socket = "0.5.0" diff --git a/src/uu/chcon/Cargo.toml b/src/uu/chcon/Cargo.toml index 08be43d2fc6..c2d14752ff6 100644 --- a/src/uu/chcon/Cargo.toml +++ b/src/uu/chcon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_chcon" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "chcon ~ (uutils) change file security context" diff --git a/src/uu/chgrp/Cargo.toml b/src/uu/chgrp/Cargo.toml index 4da81ad8c77..934329413d2 100644 --- a/src/uu/chgrp/Cargo.toml +++ b/src/uu/chgrp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_chgrp" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "chgrp ~ (uutils) change the group ownership of FILE" @@ -16,8 +16,8 @@ path = "src/chgrp.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries", "fs", "perms"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "chgrp" diff --git a/src/uu/chmod/Cargo.toml b/src/uu/chmod/Cargo.toml index 3fc3bbffaa9..a212dd0e6e0 100644 --- a/src/uu/chmod/Cargo.toml +++ b/src/uu/chmod/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_chmod" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "chmod ~ (uutils) change mode of FILE" @@ -17,8 +17,8 @@ path = "src/chmod.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs", "mode"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "mode"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } walkdir = "2.2" [[bin]] diff --git a/src/uu/chown/Cargo.toml b/src/uu/chown/Cargo.toml index 1e66a726041..9a5bba7c7ef 100644 --- a/src/uu/chown/Cargo.toml +++ b/src/uu/chown/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_chown" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "chown ~ (uutils) change the ownership of FILE" @@ -16,8 +16,8 @@ path = "src/chown.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries", "fs", "perms"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "chown" diff --git a/src/uu/chroot/Cargo.toml b/src/uu/chroot/Cargo.toml index 0dc00553c46..6e023742e3d 100644 --- a/src/uu/chroot/Cargo.toml +++ b/src/uu/chroot/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_chroot" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "chroot ~ (uutils) run COMMAND under a new root directory" @@ -16,8 +16,8 @@ path = "src/chroot.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "chroot" diff --git a/src/uu/cksum/Cargo.toml b/src/uu/cksum/Cargo.toml index 3adb93ae89e..0bd7b6c89b8 100644 --- a/src/uu/cksum/Cargo.toml +++ b/src/uu/cksum/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_cksum" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "cksum ~ (uutils) display CRC and size of input" @@ -17,8 +17,8 @@ path = "src/cksum.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "cksum" diff --git a/src/uu/comm/Cargo.toml b/src/uu/comm/Cargo.toml index 2faceef5042..6e6ae1b4094 100644 --- a/src/uu/comm/Cargo.toml +++ b/src/uu/comm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_comm" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "comm ~ (uutils) compare sorted inputs" @@ -17,8 +17,8 @@ path = "src/comm.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "comm" diff --git a/src/uu/cp/Cargo.toml b/src/uu/cp/Cargo.toml index f72575bbb76..35252a463dd 100644 --- a/src/uu/cp/Cargo.toml +++ b/src/uu/cp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_cp" -version = "0.0.8" +version = "0.0.9" authors = [ "Jordy Dickinson ", "Joshua S. Miller ", @@ -24,8 +24,8 @@ filetime = "0.2" libc = "0.2.85" quick-error = "1.2.3" selinux = { version="0.2.3", optional=true } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries", "fs", "perms", "mode"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms", "mode"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } walkdir = "2.2" [target.'cfg(target_os = "linux")'.dependencies] diff --git a/src/uu/csplit/Cargo.toml b/src/uu/csplit/Cargo.toml index 3a96043746a..ba3678e4f87 100644 --- a/src/uu/csplit/Cargo.toml +++ b/src/uu/csplit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_csplit" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "csplit ~ (uutils) Output pieces of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ..., and output byte counts of each piece to standard output" @@ -18,8 +18,8 @@ path = "src/csplit.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } thiserror = "1.0" regex = "1.0.0" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries", "fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "csplit" diff --git a/src/uu/cut/Cargo.toml b/src/uu/cut/Cargo.toml index bd736396c5f..c788cd5f8f3 100644 --- a/src/uu/cut/Cargo.toml +++ b/src/uu/cut/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_cut" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "cut ~ (uutils) display byte/field columns of input lines" @@ -16,8 +16,8 @@ path = "src/cut.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } memchr = "2" bstr = "0.2" atty = "0.2" diff --git a/src/uu/date/Cargo.toml b/src/uu/date/Cargo.toml index af259f4f1e0..21098b169d5 100644 --- a/src/uu/date/Cargo.toml +++ b/src/uu/date/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_date" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "date ~ (uutils) display or set the current time" @@ -15,10 +15,10 @@ edition = "2018" path = "src/date.rs" [dependencies] -chrono = "0.4.4" +chrono = "^0.4.11" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(unix)'.dependencies] libc = "0.2" diff --git a/src/uu/dd/Cargo.toml b/src/uu/dd/Cargo.toml index d370c564217..d8aa0671181 100644 --- a/src/uu/dd/Cargo.toml +++ b/src/uu/dd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_dd" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "dd ~ (uutils) copy and convert files" diff --git a/src/uu/df/Cargo.toml b/src/uu/df/Cargo.toml index 5fb1198b997..6029d187e7d 100644 --- a/src/uu/df/Cargo.toml +++ b/src/uu/df/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_df" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "df ~ (uutils) display file system information" @@ -17,8 +17,8 @@ path = "src/df.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } number_prefix = "0.4" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc", "fsext"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["libc", "fsext"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "df" diff --git a/src/uu/dircolors/Cargo.toml b/src/uu/dircolors/Cargo.toml index 2af6281c3f3..cb604928c0e 100644 --- a/src/uu/dircolors/Cargo.toml +++ b/src/uu/dircolors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_dircolors" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "dircolors ~ (uutils) display commands to set LS_COLORS" @@ -17,8 +17,8 @@ path = "src/dircolors.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } glob = "0.3.0" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "dircolors" diff --git a/src/uu/dirname/Cargo.toml b/src/uu/dirname/Cargo.toml index 98157b82aac..87e01ad3c08 100644 --- a/src/uu/dirname/Cargo.toml +++ b/src/uu/dirname/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_dirname" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "dirname ~ (uutils) display parent directory of PATHNAME" @@ -17,8 +17,8 @@ path = "src/dirname.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "dirname" diff --git a/src/uu/du/Cargo.toml b/src/uu/du/Cargo.toml index b08d1750006..610bccff753 100644 --- a/src/uu/du/Cargo.toml +++ b/src/uu/du/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_du" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "du ~ (uutils) display disk usage" @@ -15,10 +15,10 @@ edition = "2018" path = "src/du.rs" [dependencies] +chrono = "^0.4.11" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -chrono = "0.4" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(target_os = "windows")'.dependencies] winapi = { version="0.3", features=[] } diff --git a/src/uu/echo/Cargo.toml b/src/uu/echo/Cargo.toml index e316bbaa4e7..d79e3926d43 100644 --- a/src/uu/echo/Cargo.toml +++ b/src/uu/echo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_echo" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "echo ~ (uutils) display TEXT" @@ -16,8 +16,8 @@ path = "src/echo.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "echo" diff --git a/src/uu/env/Cargo.toml b/src/uu/env/Cargo.toml index 66a7fba1ded..480cd90028d 100644 --- a/src/uu/env/Cargo.toml +++ b/src/uu/env/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_env" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "env ~ (uutils) set each NAME to VALUE in the environment and run COMMAND" @@ -18,8 +18,8 @@ path = "src/env.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" rust-ini = "0.17.0" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "env" diff --git a/src/uu/expand/Cargo.toml b/src/uu/expand/Cargo.toml index db7bdf74ab8..daf2f706991 100644 --- a/src/uu/expand/Cargo.toml +++ b/src/uu/expand/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_expand" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "expand ~ (uutils) convert input tabs to spaces" @@ -17,8 +17,8 @@ path = "src/expand.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } unicode-width = "0.1.5" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "expand" diff --git a/src/uu/expr/Cargo.toml b/src/uu/expr/Cargo.toml index 6f081a257c1..7e3cafc4415 100644 --- a/src/uu/expr/Cargo.toml +++ b/src/uu/expr/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_expr" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "expr ~ (uutils) display the value of EXPRESSION" @@ -20,8 +20,8 @@ libc = "0.2.42" num-bigint = "0.4.0" num-traits = "0.2.14" onig = "~4.3.2" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "expr" diff --git a/src/uu/factor/Cargo.toml b/src/uu/factor/Cargo.toml index 0bf4248ce37..e9c4b297615 100644 --- a/src/uu/factor/Cargo.toml +++ b/src/uu/factor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_factor" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "factor ~ (uutils) display the prime factors of each NUMBER" @@ -21,7 +21,7 @@ num-traits = "0.2.13" # Needs at least version 0.2.13 for "OverflowingAdd" rand = { version = "0.7", features = ["small_rng"] } smallvec = "1.7" # TODO(nicoo): Use `union` feature, requires Rust 1.49 or later. uucore = { version = ">=0.0.8", package = "uucore", path = "../../uucore" } -uucore_procs = { version=">=0.0.7", package = "uucore_procs", path = "../../uucore_procs" } +uucore_procs = { version=">=0.0.8", package = "uucore_procs", path = "../../uucore_procs" } [dev-dependencies] paste = "0.1.18" diff --git a/src/uu/false/Cargo.toml b/src/uu/false/Cargo.toml index 06db62a9aeb..318165db823 100644 --- a/src/uu/false/Cargo.toml +++ b/src/uu/false/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_false" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "false ~ (uutils) do nothing and fail" @@ -16,8 +16,8 @@ path = "src/false.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "false" diff --git a/src/uu/fmt/Cargo.toml b/src/uu/fmt/Cargo.toml index b70faf5435b..f6c1e4af174 100644 --- a/src/uu/fmt/Cargo.toml +++ b/src/uu/fmt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_fmt" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "fmt ~ (uutils) reformat each paragraph of input" @@ -18,8 +18,8 @@ path = "src/fmt.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" unicode-width = "0.1.5" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "fmt" diff --git a/src/uu/fold/Cargo.toml b/src/uu/fold/Cargo.toml index 600547bda33..6eef2b591cf 100644 --- a/src/uu/fold/Cargo.toml +++ b/src/uu/fold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_fold" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "fold ~ (uutils) wrap each line of input" @@ -16,8 +16,8 @@ path = "src/fold.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "fold" diff --git a/src/uu/groups/Cargo.toml b/src/uu/groups/Cargo.toml index 412e35f289a..485cfd25f71 100644 --- a/src/uu/groups/Cargo.toml +++ b/src/uu/groups/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_groups" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "groups ~ (uutils) display group memberships for USERNAME" @@ -15,9 +15,9 @@ edition = "2018" path = "src/groups.rs" [dependencies] -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries", "process"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } clap = { version = "3.0", features = ["wrap_help", "cargo"] } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "process"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "groups" diff --git a/src/uu/hashsum/Cargo.toml b/src/uu/hashsum/Cargo.toml index 730eb928539..9a7f0ae51e7 100644 --- a/src/uu/hashsum/Cargo.toml +++ b/src/uu/hashsum/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_hashsum" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "hashsum ~ (uutils) display or check input digests" @@ -27,8 +27,8 @@ sha1 = "0.6.0" sha2 = "0.6.0" sha3 = "0.6.0" blake2b_simd = "0.5.11" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "hashsum" diff --git a/src/uu/head/BENCHMARKING.md b/src/uu/head/BENCHMARKING.md index 49574eb794b..29ce4c46b43 100644 --- a/src/uu/head/BENCHMARKING.md +++ b/src/uu/head/BENCHMARKING.md @@ -20,7 +20,7 @@ and most other parts of the world. This particular file has about 170,000 lines, each of which is no longer than 96 characters: - $ wc -lL shakespeare.txt + $ wc -lL shakespeare.txt 170592 96 shakespeare.txt You could use files of different shapes and sizes to test the diff --git a/src/uu/head/Cargo.toml b/src/uu/head/Cargo.toml index 78f4abcd88e..7acb202e6aa 100644 --- a/src/uu/head/Cargo.toml +++ b/src/uu/head/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_head" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "head ~ (uutils) display the first lines of input" @@ -17,8 +17,8 @@ path = "src/head.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } memchr = "2" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["ringbuffer"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "head" diff --git a/src/uu/hostid/Cargo.toml b/src/uu/hostid/Cargo.toml index b0fbcf9e985..674ac1e3007 100644 --- a/src/uu/hostid/Cargo.toml +++ b/src/uu/hostid/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_hostid" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "hostid ~ (uutils) display the numeric identifier of the current host" @@ -17,8 +17,8 @@ path = "src/hostid.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "hostid" diff --git a/src/uu/hostname/Cargo.toml b/src/uu/hostname/Cargo.toml index 493436437ff..b56ccf0f249 100644 --- a/src/uu/hostname/Cargo.toml +++ b/src/uu/hostname/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_hostname" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "hostname ~ (uutils) display or set the host name of the current host" @@ -18,8 +18,8 @@ path = "src/hostname.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" hostname = { version = "0.3", features = ["set"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["wide"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["wide"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } winapi = { version="0.3", features=["sysinfoapi", "winsock2"] } [[bin]] diff --git a/src/uu/id/Cargo.toml b/src/uu/id/Cargo.toml index 7f0db3e935d..752e58d67ad 100644 --- a/src/uu/id/Cargo.toml +++ b/src/uu/id/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_id" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "id ~ (uutils) display user and group information for USER" @@ -16,8 +16,8 @@ path = "src/id.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries", "process"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "process"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } selinux = { version="0.2.1", optional = true } [[bin]] diff --git a/src/uu/install/Cargo.toml b/src/uu/install/Cargo.toml index 8661a575480..4bd7c93d44d 100644 --- a/src/uu/install/Cargo.toml +++ b/src/uu/install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_install" -version = "0.0.8" +version = "0.0.9" authors = [ "Ben Eills ", "uutils developers", @@ -22,8 +22,8 @@ clap = { version = "3.0", features = ["wrap_help", "cargo"] } filetime = "0.2" file_diff = "1.0.0" libc = ">= 0.2" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs", "mode", "perms", "entries"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "mode", "perms", "entries"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [dev-dependencies] time = "0.1.40" diff --git a/src/uu/join/Cargo.toml b/src/uu/join/Cargo.toml index 37596c8351e..0d22d093549 100644 --- a/src/uu/join/Cargo.toml +++ b/src/uu/join/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_join" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "join ~ (uutils) merge lines from inputs with matching join fields" @@ -16,8 +16,8 @@ path = "src/join.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "join" diff --git a/src/uu/join/src/join.rs b/src/uu/join/src/join.rs index eacc11f0311..4729072d33a 100644 --- a/src/uu/join/src/join.rs +++ b/src/uu/join/src/join.rs @@ -13,7 +13,7 @@ extern crate uucore; use clap::{crate_version, App, Arg}; use std::cmp::Ordering; use std::fs::File; -use std::io::{stdin, BufRead, BufReader, Lines, Stdin}; +use std::io::{stdin, stdout, BufRead, BufReader, Split, Stdin, Write}; use uucore::display::Quotable; use uucore::error::{set_exit_code, UResult, USimpleError}; @@ -25,9 +25,16 @@ enum FileNum { File2, } +#[repr(u8)] +#[derive(Copy, Clone)] +enum LineEnding { + Nul = 0, + Newline = b'\n', +} + #[derive(Copy, Clone)] enum Sep { - Char(char), + Char(u8), Line, Whitespaces, } @@ -46,10 +53,11 @@ struct Settings { print_unpaired2: bool, print_joined: bool, ignore_case: bool, + line_ending: LineEnding, separator: Sep, autoformat: bool, format: Vec, - empty: String, + empty: Vec, check_order: CheckOrder, headers: bool, } @@ -63,10 +71,11 @@ impl Default for Settings { print_unpaired2: false, print_joined: true, ignore_case: false, + line_ending: LineEnding::Newline, separator: Sep::Whitespaces, autoformat: false, format: vec![], - empty: String::new(), + empty: vec![], check_order: CheckOrder::Default, headers: false, } @@ -75,14 +84,21 @@ impl Default for Settings { /// Output representation. struct Repr<'a> { - separator: char, + line_ending: LineEnding, + separator: u8, format: &'a [Spec], - empty: &'a str, + empty: &'a [u8], } impl<'a> Repr<'a> { - fn new(separator: char, format: &'a [Spec], empty: &'a str) -> Repr<'a> { + fn new( + line_ending: LineEnding, + separator: u8, + format: &'a [Spec], + empty: &'a [u8], + ) -> Repr<'a> { Repr { + line_ending, separator, format, empty, @@ -94,32 +110,34 @@ impl<'a> Repr<'a> { } /// Print the field or empty filler if the field is not set. - fn print_field(&self, field: Option<&str>) { + fn print_field(&self, field: Option<&Vec>) -> Result<(), std::io::Error> { let value = match field { Some(field) => field, None => self.empty, }; - print!("{}", value); + stdout().write_all(value) } /// Print each field except the one at the index. - fn print_fields(&self, line: &Line, index: usize) { + fn print_fields(&self, line: &Line, index: usize) -> Result<(), std::io::Error> { for i in 0..line.fields.len() { if i != index { - print!("{}{}", self.separator, line.fields[i]); + stdout().write_all(&[self.separator])?; + stdout().write_all(&line.fields[i])?; } } + Ok(()) } /// Print each field or the empty filler if the field is not set. - fn print_format(&self, f: F) + fn print_format(&self, f: F) -> Result<(), std::io::Error> where - F: Fn(&Spec) -> Option<&'a str>, + F: Fn(&Spec) -> Option<&'a Vec>, { for i in 0..self.format.len() { if i > 0 { - print!("{}", self.separator); + stdout().write_all(&[self.separator])?; } let field = match f(&self.format[i]) { @@ -127,8 +145,13 @@ impl<'a> Repr<'a> { None => self.empty, }; - print!("{}", field); + stdout().write_all(field)?; } + Ok(()) + } + + fn print_line_ending(&self) -> Result<(), std::io::Error> { + stdout().write_all(&[self.line_ending as u8]) } } @@ -148,10 +171,12 @@ impl Input { } } - fn compare(&self, field1: Option<&str>, field2: Option<&str>) -> Ordering { + fn compare(&self, field1: Option<&Vec>, field2: Option<&Vec>) -> Ordering { if let (Some(field1), Some(field2)) = (field1, field2) { if self.ignore_case { - field1.to_lowercase().cmp(&field2.to_lowercase()) + field1 + .to_ascii_lowercase() + .cmp(&field2.to_ascii_lowercase()) } else { field1.cmp(field2) } @@ -209,14 +234,19 @@ impl Spec { } struct Line { - fields: Vec, + fields: Vec>, } impl Line { - fn new(string: String, separator: Sep) -> Line { + fn new(string: Vec, separator: Sep) -> Line { let fields = match separator { - Sep::Whitespaces => string.split_whitespace().map(String::from).collect(), - Sep::Char(sep) => string.split(sep).map(String::from).collect(), + Sep::Whitespaces => string + // GNU join uses Bourne shell field splitters by default + .split(|c| matches!(*c, b' ' | b'\t' | b'\n')) + .filter(|f| !f.is_empty()) + .map(Vec::from) + .collect(), + Sep::Char(sep) => string.split(|c| *c == sep).map(Vec::from).collect(), Sep::Line => vec![string], }; @@ -224,7 +254,7 @@ impl Line { } /// Get field at index. - fn get_field(&self, index: usize) -> Option<&str> { + fn get_field(&self, index: usize) -> Option<&Vec> { if index < self.fields.len() { Some(&self.fields[index]) } else { @@ -238,7 +268,7 @@ struct State<'a> { file_name: &'a str, file_num: FileNum, print_unpaired: bool, - lines: Lines>, + lines: Split>, seq: Vec, line_num: usize, has_failed: bool, @@ -250,6 +280,7 @@ impl<'a> State<'a> { name: &'a str, stdin: &'a Stdin, key: usize, + line_ending: LineEnding, print_unpaired: bool, ) -> State<'a> { let f = if name == "-" { @@ -266,7 +297,7 @@ impl<'a> State<'a> { file_name: name, file_num, print_unpaired, - lines: f.lines(), + lines: f.split(line_ending as u8), seq: Vec::new(), line_num: 0, has_failed: false, @@ -274,12 +305,13 @@ impl<'a> State<'a> { } /// Skip the current unpaired line. - fn skip_line(&mut self, input: &Input, repr: &Repr) { + fn skip_line(&mut self, input: &Input, repr: &Repr) -> Result<(), std::io::Error> { if self.print_unpaired { - self.print_first_line(repr); + self.print_first_line(repr)?; } self.reset_next_line(input); + Ok(()) } /// Keep reading line sequence until the key does not change, return @@ -299,20 +331,22 @@ impl<'a> State<'a> { } /// Print lines in the buffers as headers. - fn print_headers(&self, other: &State, repr: &Repr) { + fn print_headers(&self, other: &State, repr: &Repr) -> Result<(), std::io::Error> { if self.has_line() { if other.has_line() { - self.combine(other, repr); + self.combine(other, repr)?; } else { - self.print_first_line(repr); + self.print_first_line(repr)?; } } else if other.has_line() { - other.print_first_line(repr); + other.print_first_line(repr)?; } + + Ok(()) } /// Combine two line sequences. - fn combine(&self, other: &State, repr: &Repr) { + fn combine(&self, other: &State, repr: &Repr) -> Result<(), std::io::Error> { let key = self.get_current_key(); for line1 in &self.seq { @@ -331,16 +365,18 @@ impl<'a> State<'a> { None } - }); + })?; } else { - repr.print_field(key); - repr.print_fields(line1, self.key); - repr.print_fields(line2, other.key); + repr.print_field(key)?; + repr.print_fields(line1, self.key)?; + repr.print_fields(line2, other.key)?; } - println!(); + repr.print_line_ending()?; } } + + Ok(()) } /// Reset with the next line. @@ -377,14 +413,16 @@ impl<'a> State<'a> { 0 } - fn finalize(&mut self, input: &Input, repr: &Repr) { + fn finalize(&mut self, input: &Input, repr: &Repr) -> Result<(), std::io::Error> { if self.has_line() && self.print_unpaired { - self.print_first_line(repr); + self.print_first_line(repr)?; while let Some(line) = self.next_line(input) { - self.print_line(&line, repr); + self.print_line(&line, repr)?; } } + + Ok(()) } /// Get the next line without the order check. @@ -423,11 +461,11 @@ impl<'a> State<'a> { } /// Gets the key value of the lines stored in seq. - fn get_current_key(&self) -> Option<&str> { + fn get_current_key(&self) -> Option<&Vec> { self.seq[0].get_field(self.key) } - fn print_line(&self, line: &Line, repr: &Repr) { + fn print_line(&self, line: &Line, repr: &Repr) -> Result<(), std::io::Error> { if repr.uses_format() { repr.print_format(|spec| match *spec { Spec::Key => line.get_field(self.key), @@ -438,17 +476,17 @@ impl<'a> State<'a> { None } } - }); + })?; } else { - repr.print_field(line.get_field(self.key)); - repr.print_fields(line, self.key); + repr.print_field(line.get_field(self.key))?; + repr.print_fields(line, self.key)?; } - println!(); + repr.print_line_ending() } - fn print_first_line(&self, repr: &Repr) { - self.print_line(&self.seq[0], repr); + fn print_first_line(&self, repr: &Repr) -> Result<(), std::io::Error> { + self.print_line(&self.seq[0], repr) } } @@ -481,14 +519,15 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { settings.key1 = get_field_number(keys, key1)?; settings.key2 = get_field_number(keys, key2)?; - if let Some(value) = matches.value_of("t") { + if let Some(value_str) = matches.value_of("t") { + let value = value_str.as_bytes(); settings.separator = match value.len() { 0 => Sep::Line, - 1 => Sep::Char(value.chars().next().unwrap()), + 1 => Sep::Char(value[0]), _ => { return Err(USimpleError::new( 1, - format!("multi-character tab {}", value), + format!("multi-character tab {}", value_str), )) } }; @@ -507,7 +546,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { } if let Some(empty) = matches.value_of("e") { - settings.empty = empty.to_string(); + settings.empty = empty.as_bytes().to_vec(); } if matches.is_present("nocheck-order") { @@ -522,6 +561,10 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { settings.headers = true; } + if matches.is_present("z") { + settings.line_ending = LineEnding::Nul; + } + let file1 = matches.value_of("file1").unwrap(); let file2 = matches.value_of("file2").unwrap(); @@ -529,7 +572,10 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { return Err(USimpleError::new(1, "both files cannot be standard input")); } - exec(file1, file2, settings) + match exec(file1, file2, settings) { + Ok(_) => Ok(()), + Err(e) => Err(USimpleError::new(1, format!("{}", e))), + } } pub fn uu_app<'a>() -> App<'a> { @@ -623,6 +669,12 @@ FILENUM is 1 or 2, corresponding to FILE1 or FILE2", "treat the first line in each file as field headers, \ print them without trying to pair them", )) + .arg( + Arg::new("z") + .short('z') + .long("zero-terminated") + .help("line delimiter is NUL, not newline"), + ) .arg( Arg::new("file1") .required(true) @@ -637,7 +689,7 @@ FILENUM is 1 or 2, corresponding to FILE1 or FILE2", ) } -fn exec(file1: &str, file2: &str, settings: Settings) -> UResult<()> { +fn exec(file1: &str, file2: &str, settings: Settings) -> Result<(), std::io::Error> { let stdin = stdin(); let mut state1 = State::new( @@ -645,6 +697,7 @@ fn exec(file1: &str, file2: &str, settings: Settings) -> UResult<()> { file1, &stdin, settings.key1, + settings.line_ending, settings.print_unpaired1, ); @@ -653,6 +706,7 @@ fn exec(file1: &str, file2: &str, settings: Settings) -> UResult<()> { file2, &stdin, settings.key2, + settings.line_ending, settings.print_unpaired2, ); @@ -682,16 +736,17 @@ fn exec(file1: &str, file2: &str, settings: Settings) -> UResult<()> { }; let repr = Repr::new( + settings.line_ending, match settings.separator { Sep::Char(sep) => sep, - _ => ' ', + _ => b' ', }, &format, &settings.empty, ); if settings.headers { - state1.print_headers(&state2, &repr); + state1.print_headers(&state2, &repr)?; state1.reset_read_line(&input); state2.reset_read_line(&input); } @@ -701,17 +756,17 @@ fn exec(file1: &str, file2: &str, settings: Settings) -> UResult<()> { match diff { Ordering::Less => { - state1.skip_line(&input, &repr); + state1.skip_line(&input, &repr)?; } Ordering::Greater => { - state2.skip_line(&input, &repr); + state2.skip_line(&input, &repr)?; } Ordering::Equal => { let next_line1 = state1.extend(&input); let next_line2 = state2.extend(&input); if settings.print_joined { - state1.combine(&state2, &repr); + state1.combine(&state2, &repr)?; } state1.reset(next_line1); @@ -720,8 +775,8 @@ fn exec(file1: &str, file2: &str, settings: Settings) -> UResult<()> { } } - state1.finalize(&input, &repr); - state2.finalize(&input, &repr); + state1.finalize(&input, &repr)?; + state2.finalize(&input, &repr)?; if state1.has_failed || state2.has_failed { set_exit_code(1); diff --git a/src/uu/kill/Cargo.toml b/src/uu/kill/Cargo.toml index a389b9924c4..e0c9cb079b3 100644 --- a/src/uu/kill/Cargo.toml +++ b/src/uu/kill/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_kill" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "kill ~ (uutils) send a signal to a process" @@ -17,8 +17,8 @@ path = "src/kill.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["signals"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["signals"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "kill" diff --git a/src/uu/link/Cargo.toml b/src/uu/link/Cargo.toml index 348a8ef26f4..93e8d46e59d 100644 --- a/src/uu/link/Cargo.toml +++ b/src/uu/link/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_link" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "link ~ (uutils) create a hard (file system) link to FILE" @@ -16,9 +16,9 @@ path = "src/link.rs" [dependencies] libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } clap = { version = "3.0", features = ["wrap_help", "cargo"] } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "link" diff --git a/src/uu/ln/Cargo.toml b/src/uu/ln/Cargo.toml index d3b497d3011..d13ddb2a3e9 100644 --- a/src/uu/ln/Cargo.toml +++ b/src/uu/ln/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_ln" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "ln ~ (uutils) create a (file system) link to TARGET" @@ -17,8 +17,8 @@ path = "src/ln.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "ln" diff --git a/src/uu/logname/Cargo.toml b/src/uu/logname/Cargo.toml index a85d9188239..711801415b1 100644 --- a/src/uu/logname/Cargo.toml +++ b/src/uu/logname/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_logname" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "logname ~ (uutils) display the login name of the current user" @@ -17,8 +17,8 @@ path = "src/logname.rs" [dependencies] libc = "0.2.42" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "logname" diff --git a/src/uu/ls/Cargo.toml b/src/uu/ls/Cargo.toml index 34034e7449e..5796e5456e2 100644 --- a/src/uu/ls/Cargo.toml +++ b/src/uu/ls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_ls" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "ls ~ (uutils) display directory contents" @@ -24,7 +24,7 @@ termsize = "0.1.6" glob = "0.3.0" lscolors = { version = "0.7.1", features = ["ansi_term"] } uucore = { version = ">=0.0.8", package = "uucore", path = "../../uucore", features = ["entries", "fs"] } -uucore_procs = { version=">=0.0.7", package = "uucore_procs", path = "../../uucore_procs" } +uucore_procs = { version=">=0.0.8", package = "uucore_procs", path = "../../uucore_procs" } once_cell = "1.7.2" atty = "0.2" selinux = { version="0.2.1", optional = true } diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index ebe52570266..c645d8700e3 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -319,6 +319,10 @@ struct PaddingCollection { longest_group_len: usize, longest_context_len: usize, longest_size_len: usize, + #[cfg(unix)] + longest_major_len: usize, + #[cfg(unix)] + longest_minor_len: usize, } impl Config { @@ -1561,18 +1565,28 @@ fn display_dir_entry_size( entry: &PathData, config: &Config, out: &mut BufWriter, -) -> (usize, usize, usize, usize, usize) { +) -> (usize, usize, usize, usize, usize, usize, usize) { // TODO: Cache/memorize the display_* results so we don't have to recalculate them. if let Some(md) = entry.md(out) { + let (size_len, major_len, minor_len) = match display_size_or_rdev(md, config) { + SizeOrDeviceId::Device(major, minor) => ( + (major.len() + minor.len() + 2usize), + major.len(), + minor.len(), + ), + SizeOrDeviceId::Size(size) => (size.len(), 0usize, 0usize), + }; ( display_symlink_count(md).len(), display_uname(md, config).len(), display_group(md, config).len(), - display_size_or_rdev(md, config).len(), + size_len, + major_len, + minor_len, display_inode(md).len(), ) } else { - (0, 0, 0, 0, 0) + (0, 0, 0, 0, 0, 0, 0) } } @@ -1609,7 +1623,9 @@ fn display_items(items: &[PathData], config: &Config, out: &mut BufWriter = items .iter() - .map(|i| display_file_name(i, config, prefix_context, out)) + .map(|i| display_file_name(i, config, prefix_context, longest_inode_len, out)) .collect::>() .into_iter(); @@ -1879,17 +1930,41 @@ fn display_item_long( ); } - let dfn = display_file_name(item, config, None, out).contents; + match display_size_or_rdev(md, config) { + SizeOrDeviceId::Size(size) => { + let _ = write!(out, " {}", pad_left(&size, padding.longest_size_len),); + } + SizeOrDeviceId::Device(major, minor) => { + let _ = write!( + out, + " {}, {}", + pad_left( + &major, + #[cfg(not(unix))] + 0usize, + #[cfg(unix)] + padding.longest_major_len.max( + padding + .longest_size_len + .saturating_sub(padding.longest_minor_len.saturating_add(2usize)) + ) + ), + pad_left( + &minor, + #[cfg(not(unix))] + 0usize, + #[cfg(unix)] + padding.longest_minor_len, + ), + ); + } + }; - let _ = writeln!( - out, - " {} {} {}", - pad_left(&display_size_or_rdev(md, config), padding.longest_size_len), - display_date(md, config), - dfn, - ); + let dfn = display_file_name(item, config, None, 0, out).contents; + + let _ = writeln!(out, " {} {}", display_date(md, config), dfn); } else { - // this 'else' is expressly for the case of a dangling symlink + // this 'else' is expressly for the case of a dangling symlink/restricted file #[cfg(unix)] { if config.inode { @@ -1900,7 +1975,7 @@ fn display_item_long( let _ = write!( out, "{}{} {}", - "l?????????".to_string(), + "l?????????", if item.security_context.len() > 1 { // GNU `ls` uses a "." character to indicate a file with a security context, // but not other alternate access method. @@ -1933,7 +2008,7 @@ fn display_item_long( let _ = write!(out, " {}", pad_right("?", padding.longest_uname_len)); } - let dfn = display_file_name(item, config, None, out).contents; + let dfn = display_file_name(item, config, None, 0, out).contents; let date_len = 12; let _ = writeln!( @@ -2097,19 +2172,35 @@ fn format_prefixed(prefixed: NumberPrefix) -> String { } } -fn display_size_or_rdev(metadata: &Metadata, config: &Config) -> String { - #[cfg(unix)] +#[allow(dead_code)] +enum SizeOrDeviceId { + Size(String), + Device(String, String), +} + +fn display_size_or_rdev(metadata: &Metadata, config: &Config) -> SizeOrDeviceId { + #[cfg(any(target_os = "macos", target_os = "ios"))] + { + let ft = metadata.file_type(); + if ft.is_char_device() || ft.is_block_device() { + let dev: u64 = metadata.rdev(); + let major = (dev >> 24) as u8; + let minor = (dev & 0xff) as u8; + return SizeOrDeviceId::Device(major.to_string(), minor.to_string()); + } + } + #[cfg(target_os = "linux")] { let ft = metadata.file_type(); if ft.is_char_device() || ft.is_block_device() { let dev: u64 = metadata.rdev(); let major = (dev >> 8) as u8; - let minor = dev as u8; - return format!("{}, {}", major, minor,); + let minor = (dev & 0xff) as u8; + return SizeOrDeviceId::Device(major.to_string(), minor.to_string()); } } - display_size(metadata.len(), config) + SizeOrDeviceId::Size(display_size(metadata.len(), config)) } fn display_size(size: u64, config: &Config) -> String { @@ -2175,6 +2266,7 @@ fn display_file_name( path: &PathData, config: &Config, prefix_context: Option, + longest_inode_len: usize, out: &mut BufWriter, ) -> Cell { // This is our return value. We start by `&path.display_name` and modify it along the way. @@ -2194,8 +2286,8 @@ fn display_file_name( { if config.inode && config.format != Format::Long { let inode = match path.md(out) { - Some(md) => get_inode(md), - None => "?".to_string(), + Some(md) => pad_left(&get_inode(md), longest_inode_len), + None => pad_left("?", longest_inode_len), }; // increment width here b/c name was given colors and name.width() is now the wrong // size for display diff --git a/src/uu/mkdir/Cargo.toml b/src/uu/mkdir/Cargo.toml index 23e22308c9a..2961fe4c7e3 100644 --- a/src/uu/mkdir/Cargo.toml +++ b/src/uu/mkdir/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_mkdir" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "mkdir ~ (uutils) create DIRECTORY" @@ -17,8 +17,8 @@ path = "src/mkdir.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs", "mode"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "mode"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "mkdir" diff --git a/src/uu/mkfifo/Cargo.toml b/src/uu/mkfifo/Cargo.toml index d593f75e954..69f77f32e1f 100644 --- a/src/uu/mkfifo/Cargo.toml +++ b/src/uu/mkfifo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_mkfifo" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "mkfifo ~ (uutils) create FIFOs (named pipes)" @@ -17,8 +17,8 @@ path = "src/mkfifo.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "mkfifo" diff --git a/src/uu/mknod/Cargo.toml b/src/uu/mknod/Cargo.toml index deffa1af63e..018c679aab0 100644 --- a/src/uu/mknod/Cargo.toml +++ b/src/uu/mknod/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_mknod" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "mknod ~ (uutils) create special file NAME of TYPE" @@ -18,8 +18,8 @@ path = "src/mknod.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "^0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["mode"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["mode"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "mknod" diff --git a/src/uu/mktemp/Cargo.toml b/src/uu/mktemp/Cargo.toml index b03dcbee08b..4317d018cf9 100644 --- a/src/uu/mktemp/Cargo.toml +++ b/src/uu/mktemp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_mktemp" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "mktemp ~ (uutils) create and display a temporary file or directory from TEMPLATE" @@ -18,8 +18,8 @@ path = "src/mktemp.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } rand = "0.5" tempfile = "3.1" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "mktemp" diff --git a/src/uu/more/Cargo.toml b/src/uu/more/Cargo.toml index fae4b751998..63d761d1a7e 100644 --- a/src/uu/more/Cargo.toml +++ b/src/uu/more/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_more" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "more ~ (uutils) input perusal filter" @@ -17,7 +17,7 @@ path = "src/more.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } uucore = { version = ">=0.0.7", package = "uucore", path = "../../uucore" } -uucore_procs = { version=">=0.0.7", package = "uucore_procs", path = "../../uucore_procs" } +uucore_procs = { version=">=0.0.8", package = "uucore_procs", path = "../../uucore_procs" } crossterm = ">=0.19" atty = "0.2" unicode-width = "0.1.7" diff --git a/src/uu/mv/Cargo.toml b/src/uu/mv/Cargo.toml index 894df71d1a5..21b0fac9069 100644 --- a/src/uu/mv/Cargo.toml +++ b/src/uu/mv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_mv" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "mv ~ (uutils) move (rename) SOURCE to DESTINATION" @@ -17,8 +17,8 @@ path = "src/mv.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } fs_extra = "1.1.0" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "mv" diff --git a/src/uu/nice/Cargo.toml b/src/uu/nice/Cargo.toml index e14fb1d1494..9d39022dc0f 100644 --- a/src/uu/nice/Cargo.toml +++ b/src/uu/nice/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_nice" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "nice ~ (uutils) run PROGRAM with modified scheduling priority" @@ -18,8 +18,8 @@ path = "src/nice.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" nix = "0.23.1" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "nice" diff --git a/src/uu/nl/Cargo.toml b/src/uu/nl/Cargo.toml index 361126681e1..205e1fdd0a7 100644 --- a/src/uu/nl/Cargo.toml +++ b/src/uu/nl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_nl" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "nl ~ (uutils) display input with added line numbers" @@ -21,12 +21,12 @@ libc = "0.2.42" memchr = "2.2.0" regex = "1.0.1" regex-syntax = "0.6.7" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "nl" path = "src/main.rs" [package.metadata.cargo-udeps.ignore] -normal = ["uucore_procs"] \ No newline at end of file +normal = ["uucore_procs"] diff --git a/src/uu/nohup/Cargo.toml b/src/uu/nohup/Cargo.toml index b44113c95a0..4a85d983559 100644 --- a/src/uu/nohup/Cargo.toml +++ b/src/uu/nohup/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_nohup" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "nohup ~ (uutils) run COMMAND, ignoring hangup signals" @@ -18,8 +18,8 @@ path = "src/nohup.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" atty = "0.2" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "nohup" diff --git a/src/uu/nproc/Cargo.toml b/src/uu/nproc/Cargo.toml index d9510887567..fc82ba4979f 100644 --- a/src/uu/nproc/Cargo.toml +++ b/src/uu/nproc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_nproc" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "nproc ~ (uutils) display the number of processing units available" @@ -18,8 +18,8 @@ path = "src/nproc.rs" libc = "0.2.42" num_cpus = "1.10" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "nproc" diff --git a/src/uu/numfmt/Cargo.toml b/src/uu/numfmt/Cargo.toml index fccfb7c7e04..5f065b73081 100644 --- a/src/uu/numfmt/Cargo.toml +++ b/src/uu/numfmt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_numfmt" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "numfmt ~ (uutils) reformat NUMBER" @@ -16,12 +16,12 @@ path = "src/numfmt.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "numfmt" path = "src/main.rs" [package.metadata.cargo-udeps.ignore] -normal = ["uucore_procs"] \ No newline at end of file +normal = ["uucore_procs"] diff --git a/src/uu/od/Cargo.toml b/src/uu/od/Cargo.toml index e00cc873778..82d0bdbf8ed 100644 --- a/src/uu/od/Cargo.toml +++ b/src/uu/od/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_od" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "od ~ (uutils) display formatted representation of input" @@ -19,8 +19,8 @@ byteorder = "1.3.2" clap = { version = "3.0", features = ["wrap_help", "cargo"] } half = "1.6" libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "od" diff --git a/src/uu/paste/Cargo.toml b/src/uu/paste/Cargo.toml index 7c1ace061f5..58ffe1ee61e 100644 --- a/src/uu/paste/Cargo.toml +++ b/src/uu/paste/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_paste" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "paste ~ (uutils) merge lines from inputs" @@ -16,8 +16,8 @@ path = "src/paste.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "paste" diff --git a/src/uu/pathchk/Cargo.toml b/src/uu/pathchk/Cargo.toml index 481c1679e8a..508568e4ffc 100644 --- a/src/uu/pathchk/Cargo.toml +++ b/src/uu/pathchk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_pathchk" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "pathchk ~ (uutils) diagnose invalid or non-portable PATHNAME" @@ -17,8 +17,8 @@ path = "src/pathchk.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "pathchk" diff --git a/src/uu/pinky/Cargo.toml b/src/uu/pinky/Cargo.toml index b81b8f33d96..893f33e24fc 100644 --- a/src/uu/pinky/Cargo.toml +++ b/src/uu/pinky/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_pinky" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "pinky ~ (uutils) display user information" @@ -15,9 +15,9 @@ edition = "2018" path = "src/pinky.rs" [dependencies] -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["utmpx", "entries"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } clap = { version = "3.0", features = ["wrap_help", "cargo"] } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["utmpx", "entries"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "pinky" diff --git a/src/uu/pr/Cargo.toml b/src/uu/pr/Cargo.toml index e067028099e..0f0969646ea 100644 --- a/src/uu/pr/Cargo.toml +++ b/src/uu/pr/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_pr" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "pr ~ (uutils) convert text files for printing" @@ -17,7 +17,7 @@ path = "src/pr.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } uucore = { version=">=0.0.7", package="uucore", path="../../uucore", features=["entries"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } getopts = "0.2.21" chrono = "0.4.19" quick-error = "2.0.1" diff --git a/src/uu/printenv/Cargo.toml b/src/uu/printenv/Cargo.toml index 438d50834ae..faf607a8bd1 100644 --- a/src/uu/printenv/Cargo.toml +++ b/src/uu/printenv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_printenv" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "printenv ~ (uutils) display value of environment VAR" @@ -16,8 +16,8 @@ path = "src/printenv.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "printenv" diff --git a/src/uu/printf/Cargo.toml b/src/uu/printf/Cargo.toml index 78186aae911..7362fbe45d9 100644 --- a/src/uu/printf/Cargo.toml +++ b/src/uu/printf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_printf" -version = "0.0.8" +version = "0.0.9" authors = [ "Nathan Ross", "uutils developers", @@ -20,8 +20,8 @@ path = "src/printf.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } itertools = "0.8.0" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "printf" diff --git a/src/uu/ptx/Cargo.toml b/src/uu/ptx/Cargo.toml index 75b8138d602..0e98c6a238d 100644 --- a/src/uu/ptx/Cargo.toml +++ b/src/uu/ptx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_ptx" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "ptx ~ (uutils) display a permuted index of input" @@ -21,8 +21,8 @@ libc = "0.2.42" memchr = "2.2.0" regex = "1.0.1" regex-syntax = "0.6.7" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "ptx" diff --git a/src/uu/pwd/Cargo.toml b/src/uu/pwd/Cargo.toml index e6886c040bb..0f472f02177 100644 --- a/src/uu/pwd/Cargo.toml +++ b/src/uu/pwd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_pwd" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "pwd ~ (uutils) display current working directory" @@ -16,8 +16,8 @@ path = "src/pwd.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "pwd" diff --git a/src/uu/readlink/Cargo.toml b/src/uu/readlink/Cargo.toml index 909bb6cec03..4dcde6fc463 100644 --- a/src/uu/readlink/Cargo.toml +++ b/src/uu/readlink/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_readlink" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "readlink ~ (uutils) display resolved path of PATHNAME" @@ -17,8 +17,8 @@ path = "src/readlink.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "readlink" diff --git a/src/uu/realpath/Cargo.toml b/src/uu/realpath/Cargo.toml index ece092b23e1..5a8dac63e48 100644 --- a/src/uu/realpath/Cargo.toml +++ b/src/uu/realpath/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_realpath" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "realpath ~ (uutils) display resolved absolute path of PATHNAME" @@ -16,8 +16,8 @@ path = "src/realpath.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "realpath" diff --git a/src/uu/relpath/Cargo.toml b/src/uu/relpath/Cargo.toml index bf5eaf2f956..c9364e82f94 100644 --- a/src/uu/relpath/Cargo.toml +++ b/src/uu/relpath/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_relpath" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "relpath ~ (uutils) display relative path of PATHNAME_TO from PATHNAME_FROM" @@ -16,8 +16,8 @@ path = "src/relpath.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "relpath" diff --git a/src/uu/rm/Cargo.toml b/src/uu/rm/Cargo.toml index c602c62bdd8..aa97bfa7995 100644 --- a/src/uu/rm/Cargo.toml +++ b/src/uu/rm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_rm" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "rm ~ (uutils) remove PATHNAME" @@ -18,8 +18,8 @@ path = "src/rm.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } walkdir = "2.2" remove_dir_all = "0.5.1" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(windows)'.dependencies] winapi = { version="0.3", features=[] } diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index c8166413190..6723f45d4ba 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -217,7 +217,7 @@ pub fn uu_app<'a>() -> App<'a> { // This is solely for testing. // Do not document. // It is relatively difficult to ensure that there is a tty on stdin. - // Since rm acts differently depending on that, without this option, + // Since rm acts differently depending on that, without this option, // it'd be harder to test the parts of rm that depend on that setting. .arg( Arg::new(PRESUME_INPUT_TTY) diff --git a/src/uu/rmdir/Cargo.toml b/src/uu/rmdir/Cargo.toml index 1c0fd674ab6..a3988e36ac6 100644 --- a/src/uu/rmdir/Cargo.toml +++ b/src/uu/rmdir/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_rmdir" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "rmdir ~ (uutils) remove empty DIRECTORY" @@ -16,8 +16,8 @@ path = "src/rmdir.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } libc = "0.2.42" [[bin]] diff --git a/src/uu/runcon/Cargo.toml b/src/uu/runcon/Cargo.toml index b424a876e9c..f8f8e4807c6 100644 --- a/src/uu/runcon/Cargo.toml +++ b/src/uu/runcon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_runcon" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "runcon ~ (uutils) run command with specified security context" diff --git a/src/uu/seq/Cargo.toml b/src/uu/seq/Cargo.toml index 658494af60a..496f60a73ea 100644 --- a/src/uu/seq/Cargo.toml +++ b/src/uu/seq/Cargo.toml @@ -1,7 +1,7 @@ # spell-checker:ignore bigdecimal [package] name = "uu_seq" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "seq ~ (uutils) display a sequence of numbers" @@ -20,8 +20,8 @@ bigdecimal = "0.3" clap = { version = "3.0", features = ["wrap_help", "cargo"] } num-bigint = "0.4.0" num-traits = "0.2.14" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "seq" diff --git a/src/uu/shred/Cargo.toml b/src/uu/shred/Cargo.toml index 168c2e5f6e0..e42bf168d6a 100644 --- a/src/uu/shred/Cargo.toml +++ b/src/uu/shred/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_shred" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "shred ~ (uutils) hide former FILE contents with repeated overwrites" @@ -18,8 +18,8 @@ path = "src/shred.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" rand = "0.7" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "shred" diff --git a/src/uu/shuf/Cargo.toml b/src/uu/shuf/Cargo.toml index 30393276e6a..26adfff375a 100644 --- a/src/uu/shuf/Cargo.toml +++ b/src/uu/shuf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_shuf" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "shuf ~ (uutils) display random permutations of input lines" @@ -17,8 +17,8 @@ path = "src/shuf.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } rand = "0.5" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "shuf" diff --git a/src/uu/sleep/Cargo.toml b/src/uu/sleep/Cargo.toml index e9e0cc6774a..539a43e733c 100644 --- a/src/uu/sleep/Cargo.toml +++ b/src/uu/sleep/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_sleep" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "sleep ~ (uutils) pause for DURATION" @@ -16,8 +16,8 @@ path = "src/sleep.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "sleep" diff --git a/src/uu/sort/Cargo.toml b/src/uu/sort/Cargo.toml index 540b3ca8e3f..786f3ff8cb1 100644 --- a/src/uu/sort/Cargo.toml +++ b/src/uu/sort/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_sort" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "sort ~ (uutils) sort input lines" @@ -27,8 +27,8 @@ rand = "0.7" rayon = "1.5" tempfile = "3" unicode-width = "0.1.8" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "sort" diff --git a/src/uu/split/Cargo.toml b/src/uu/split/Cargo.toml index 19d1a3800ed..bdc08775e20 100644 --- a/src/uu/split/Cargo.toml +++ b/src/uu/split/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_split" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "split ~ (uutils) split input into output files" @@ -16,8 +16,8 @@ path = "src/split.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "split" diff --git a/src/uu/split/src/filenames.rs b/src/uu/split/src/filenames.rs new file mode 100644 index 00000000000..da72e090e36 --- /dev/null +++ b/src/uu/split/src/filenames.rs @@ -0,0 +1,529 @@ +// * This file is part of the uutils coreutils package. +// * +// * For the full copyright and license information, please view the LICENSE +// * file that was distributed with this source code. +// spell-checker:ignore zaaa zaab zzaaaa zzzaaaaa +//! Compute filenames from a given index. +//! +//! The [`FilenameFactory`] can be used to convert a chunk index given +//! as a [`usize`] to a filename for that chunk. +//! +//! # Examples +//! +//! Create filenames of the form `chunk_??.txt`: +//! +//! ```rust,ignore +//! use crate::filenames::FilenameFactory; +//! +//! let prefix = "chunk_".to_string(); +//! let suffix = ".txt".to_string(); +//! let width = 2; +//! let use_numeric_suffix = false; +//! let factory = FilenameFactory::new(prefix, suffix, width, use_numeric_suffix); +//! +//! assert_eq!(factory.make(0).unwrap(), "chunk_aa.txt"); +//! assert_eq!(factory.make(10).unwrap(), "chunk_ak.txt"); +//! assert_eq!(factory.make(28).unwrap(), "chunk_bc.txt"); +//! ``` + +/// Base 10 logarithm. +fn log10(n: usize) -> usize { + (n as f64).log10() as usize +} + +/// Base 26 logarithm. +fn log26(n: usize) -> usize { + (n as f64).log(26.0) as usize +} + +/// Convert a radix 10 number to a radix 26 number of the given width. +/// +/// `n` is the radix 10 (that is, decimal) number to transform. This +/// function returns a [`Vec`] of unsigned integers representing the +/// digits, with the most significant digit first and the least +/// significant digit last. The returned `Vec` is always of length +/// `width`. +/// +/// If the number `n` is too large to represent within `width` digits, +/// then this function returns `None`. +/// +/// # Examples +/// +/// ```rust,ignore +/// use crate::filenames::to_radix_26; +/// +/// assert_eq!(to_radix_26(20, 2), Some(vec![0, 20])); +/// assert_eq!(to_radix_26(26, 2), Some(vec![1, 0])); +/// assert_eq!(to_radix_26(30, 2), Some(vec![1, 4])); +/// ``` +fn to_radix_26(mut n: usize, width: usize) -> Option> { + if width == 0 { + return None; + } + // Use the division algorithm to repeatedly compute the quotient + // and remainder of the number after division by the radix 26. The + // successive quotients are the digits in radix 26, from most + // significant to least significant. + let mut result = vec![]; + for w in (0..width).rev() { + let divisor = 26_usize.pow(w as u32); + let (quotient, remainder) = (n / divisor, n % divisor); + n = remainder; + // If the quotient is equal to or greater than the radix, that + // means the number `n` requires a greater width to be able to + // represent it in radix 26. + if quotient >= 26 { + return None; + } + result.push(quotient as u8); + } + Some(result) +} + +/// Convert a number between 0 and 25 into a lowercase ASCII character. +/// +/// # Examples +/// +/// ```rust,ignore +/// use crate::filenames::to_ascii_char; +/// +/// assert_eq!(to_ascii_char(&0), Some('a')); +/// assert_eq!(to_ascii_char(&25), Some('z')); +/// assert_eq!(to_ascii_char(&26), None); +/// ``` +fn to_ascii_char(n: &u8) -> Option { + // TODO In Rust v1.52.0 or later, use `char::from_digit`: + // https://doc.rust-lang.org/std/primitive.char.html#method.from_digit + // + // char::from_digit(*n as u32 + 10, 36) + // + // In that call, radix 36 is used because the characters in radix + // 36 are [0-9a-z]. We want to exclude the the first ten of those + // characters, so we add 10 to the number before conversion. + // + // Until that function is available, just add `n` to `b'a'` and + // cast to `char`. + if *n < 26 { + Some((b'a' + n) as char) + } else { + None + } +} + +/// Fixed width alphabetic string representation of index `i`. +/// +/// If `i` is greater than or equal to the number of lowercase ASCII +/// strings that can be represented in the given `width`, then this +/// function returns `None`. +/// +/// # Examples +/// +/// ```rust,ignore +/// use crate::filenames::str_prefix_fixed_width; +/// +/// assert_eq!(str_prefix_fixed_width(0, 2).as_deref(), "aa"); +/// assert_eq!(str_prefix_fixed_width(675, 2).as_deref(), "zz"); +/// assert_eq!(str_prefix_fixed_width(676, 2), None); +/// ``` +fn str_prefix_fixed_width(i: usize, width: usize) -> Option { + to_radix_26(i, width)?.iter().map(to_ascii_char).collect() +} + +/// Dynamically sized alphabetic string representation of index `i`. +/// +/// The size of the returned string starts at two then grows by 2 if +/// `i` is sufficiently large. +/// +/// # Examples +/// +/// ```rust,ignore +/// use crate::filenames::str_prefix; +/// +/// assert_eq!(str_prefix(0), "aa"); +/// assert_eq!(str_prefix(649), "yz"); +/// assert_eq!(str_prefix(650), "zaaa"); +/// assert_eq!(str_prefix(651), "zaab"); +/// ``` +fn str_prefix(i: usize) -> Option { + // This number tells us the order of magnitude of `i`, with a + // slight adjustment. + // + // We shift by 26 so that + // + // * if `i` is in the interval [0, 26^2 - 26), then `d` is 1, + // * if `i` is in the interval [26^2 - 26, 26^3 - 26), then `d` is 2, + // * if `i` is in the interval [26^3 - 26, 26^4 - 26), then `d` is 3, + // + // and so on. This will allow us to compute how many leading "z" + // characters need to appear in the string and how many characters + // to format to the right of those. + let d = log26(i + 26); + + // This is the number of leading "z" characters. + // + // For values of `i` less than 26^2 - 26, the returned string is + // just the radix 26 representation of that number with a width of + // two (using the lowercase ASCII characters as the digits). + // + // * if `i` is 26^2 - 26, then the returned string is "zaa", + // * if `i` is 26^3 - 26, then the returned string is "zzaaaa", + // * if `i` is 26^4 - 26, then the returned string is "zzzaaaaa", + // + // and so on. As you can see, the number of leading "z"s there is + // linearly increasing by 1 for each order of magnitude. + let num_fill_chars = d - 1; + + // This is the number of characters after the leading "z" characters. + let width = d + 1; + + // This is the radix 10 number to render in radix 26, to the right + // of the leading "z"s. + let number = (i + 26) - 26_usize.pow(d as u32); + + // This is the radix 26 number to render after the leading "z"s, + // collected in a `String`. + // + // For example, if `i` is 789, then `number` is 789 + 26 - 676, + // which equals 139. In radix 26 and assuming a `width` of 3, this + // number is + // + // [0, 5, 9] + // + // with the most significant digit on the left and the least + // significant digit on the right. After translating to ASCII + // lowercase letters, this becomes "afj". + let digits = str_prefix_fixed_width(number, width)?; + + // `empty` is just the empty string, to be displayed with a width + // of `num_fill_chars` and with blank spaces filled with the + // character "z". + // + // `digits` is as described in the previous comment. + Some(format!( + "{empty:z Option { + let max = 10_usize.pow(width as u32); + if i >= max { + None + } else { + Some(format!("{i:0width$}", i = i, width = width)) + } +} + +/// Dynamically sized numeric string representation of index `i`. +/// +/// The size of the returned string starts at two then grows by 2 if +/// `i` is sufficiently large. +/// +/// # Examples +/// +/// ```rust,ignore +/// use crate::filenames::num_prefix; +/// +/// assert_eq!(num_prefix(89), "89"); +/// assert_eq!(num_prefix(90), "9000"); +/// assert_eq!(num_prefix(91), "9001"); +/// ``` +fn num_prefix(i: usize) -> String { + // This number tells us the order of magnitude of `i`, with a + // slight adjustment. + // + // We shift by 10 so that + // + // * if `i` is in the interval [0, 90), then `d` is 1, + // * if `i` is in the interval [90, 990), then `d` is 2, + // * if `i` is in the interval [990, 9990), then `d` is 3, + // + // and so on. This will allow us to compute how many leading "9" + // characters need to appear in the string and how many digits to + // format to the right of those. + let d = log10(i + 10); + + // This is the number of leading "9" characters. + // + // For values of `i` less than 90, the returned string is just + // that number padded by a 0 to ensure the width is 2, but + // + // * if `i` is 90, then the returned string is "900", + // * if `i` is 990, then the returned string is "990000", + // * if `i` is 9990, then the returned string is "99900000", + // + // and so on. As you can see, the number of leading 9s there is + // linearly increasing by 1 for each order of magnitude. + let num_fill_chars = d - 1; + + // This is the number of characters after the leading "9" characters. + let width = d + 1; + + // This is the number to render after the leading "9"s. + // + // For example, if `i` is 5732, then the returned string is + // "994742". After the two "9" characters is the number 4742, + // which equals 5732 + 10 - 1000. + let number = (i + 10) - 10_usize.pow(d as u32); + + // `empty` is just the empty string, to be displayed with a width + // of `num_fill_chars` and with blank spaces filled with the + // character "9". + // + // `number` is the next remaining part of the number to render; + // for small numbers we pad with 0 and enforce a minimum width. + format!( + "{empty:9 FilenameFactory { + FilenameFactory { + prefix, + additional_suffix, + suffix_length, + use_numeric_suffix, + } + } + + /// Construct the filename for the specified element of the output collection of files. + /// + /// For an explanation of the parameters, see the struct documentation. + /// + /// If `suffix_length` has been set to a positive integer and `i` + /// is greater than or equal to the number of strings that can be + /// represented within that length, then this returns `None`. For + /// example: + /// + /// ```rust,ignore + /// use crate::filenames::FilenameFactory; + /// + /// let prefix = String::new(); + /// let suffix = String::new(); + /// let width = 1; + /// let use_numeric_suffix = true; + /// let factory = FilenameFactory::new(prefix, suffix, width, use_numeric_suffix); + /// + /// assert_eq!(factory.make(10), None); + /// ``` + pub fn make(&self, i: usize) -> Option { + let prefix = self.prefix.clone(); + let suffix1 = match (self.use_numeric_suffix, self.suffix_length) { + (true, 0) => Some(num_prefix(i)), + (false, 0) => str_prefix(i), + (true, width) => num_prefix_fixed_width(i, width), + (false, width) => str_prefix_fixed_width(i, width), + }?; + let suffix2 = &self.additional_suffix; + Some(prefix + &suffix1 + suffix2) + } +} + +#[cfg(test)] +mod tests { + use crate::filenames::num_prefix; + use crate::filenames::num_prefix_fixed_width; + use crate::filenames::str_prefix; + use crate::filenames::str_prefix_fixed_width; + use crate::filenames::to_ascii_char; + use crate::filenames::to_radix_26; + use crate::filenames::FilenameFactory; + + #[test] + fn test_to_ascii_char() { + assert_eq!(to_ascii_char(&0), Some('a')); + assert_eq!(to_ascii_char(&5), Some('f')); + assert_eq!(to_ascii_char(&25), Some('z')); + assert_eq!(to_ascii_char(&26), None); + } + + #[test] + fn test_to_radix_26_exceed_width() { + assert_eq!(to_radix_26(1, 0), None); + assert_eq!(to_radix_26(26, 1), None); + assert_eq!(to_radix_26(26 * 26, 2), None); + } + + #[test] + fn test_to_radix_26_width_one() { + assert_eq!(to_radix_26(0, 1), Some(vec![0])); + assert_eq!(to_radix_26(10, 1), Some(vec![10])); + assert_eq!(to_radix_26(20, 1), Some(vec![20])); + assert_eq!(to_radix_26(25, 1), Some(vec![25])); + } + + #[test] + fn test_to_radix_26_width_two() { + assert_eq!(to_radix_26(0, 2), Some(vec![0, 0])); + assert_eq!(to_radix_26(10, 2), Some(vec![0, 10])); + assert_eq!(to_radix_26(20, 2), Some(vec![0, 20])); + assert_eq!(to_radix_26(25, 2), Some(vec![0, 25])); + + assert_eq!(to_radix_26(26, 2), Some(vec![1, 0])); + assert_eq!(to_radix_26(30, 2), Some(vec![1, 4])); + + assert_eq!(to_radix_26(26 * 2, 2), Some(vec![2, 0])); + assert_eq!(to_radix_26(26 * 26 - 1, 2), Some(vec![25, 25])); + } + + #[test] + fn test_str_prefix_dynamic_width() { + assert_eq!(str_prefix(0).as_deref(), Some("aa")); + assert_eq!(str_prefix(1).as_deref(), Some("ab")); + assert_eq!(str_prefix(2).as_deref(), Some("ac")); + assert_eq!(str_prefix(25).as_deref(), Some("az")); + + assert_eq!(str_prefix(26).as_deref(), Some("ba")); + assert_eq!(str_prefix(27).as_deref(), Some("bb")); + assert_eq!(str_prefix(28).as_deref(), Some("bc")); + assert_eq!(str_prefix(51).as_deref(), Some("bz")); + + assert_eq!(str_prefix(52).as_deref(), Some("ca")); + + assert_eq!(str_prefix(26 * 25 - 1).as_deref(), Some("yz")); + assert_eq!(str_prefix(26 * 25).as_deref(), Some("zaaa")); + assert_eq!(str_prefix(26 * 25 + 1).as_deref(), Some("zaab")); + } + + #[test] + fn test_num_prefix_dynamic_width() { + assert_eq!(num_prefix(0), "00"); + assert_eq!(num_prefix(9), "09"); + assert_eq!(num_prefix(17), "17"); + assert_eq!(num_prefix(89), "89"); + assert_eq!(num_prefix(90), "9000"); + assert_eq!(num_prefix(91), "9001"); + assert_eq!(num_prefix(989), "9899"); + assert_eq!(num_prefix(990), "990000"); + } + + #[test] + fn test_str_prefix_fixed_width() { + assert_eq!(str_prefix_fixed_width(0, 2).as_deref(), Some("aa")); + assert_eq!(str_prefix_fixed_width(1, 2).as_deref(), Some("ab")); + assert_eq!(str_prefix_fixed_width(26, 2).as_deref(), Some("ba")); + assert_eq!( + str_prefix_fixed_width(26 * 26 - 1, 2).as_deref(), + Some("zz") + ); + assert_eq!(str_prefix_fixed_width(26 * 26, 2).as_deref(), None); + } + + #[test] + fn test_num_prefix_fixed_width() { + assert_eq!(num_prefix_fixed_width(0, 2).as_deref(), Some("00")); + assert_eq!(num_prefix_fixed_width(1, 2).as_deref(), Some("01")); + assert_eq!(num_prefix_fixed_width(99, 2).as_deref(), Some("99")); + assert_eq!(num_prefix_fixed_width(100, 2).as_deref(), None); + } + + #[test] + fn test_alphabetic_suffix() { + let factory = FilenameFactory::new("123".to_string(), "789".to_string(), 3, false); + assert_eq!(factory.make(0).unwrap(), "123aaa789"); + assert_eq!(factory.make(1).unwrap(), "123aab789"); + assert_eq!(factory.make(28).unwrap(), "123abc789"); + } + + #[test] + fn test_numeric_suffix() { + let factory = FilenameFactory::new("abc".to_string(), "xyz".to_string(), 3, true); + assert_eq!(factory.make(0).unwrap(), "abc000xyz"); + assert_eq!(factory.make(1).unwrap(), "abc001xyz"); + assert_eq!(factory.make(123).unwrap(), "abc123xyz"); + } +} diff --git a/src/uu/split/src/split.rs b/src/uu/split/src/split.rs index 4afc2d8e98a..6a057619770 100644 --- a/src/uu/split/src/split.rs +++ b/src/uu/split/src/split.rs @@ -7,15 +7,17 @@ // spell-checker:ignore (ToDO) PREFIXaa +mod filenames; mod platform; +use crate::filenames::FilenameFactory; use clap::{crate_version, App, Arg, ArgMatches}; use std::convert::TryFrom; use std::env; +use std::fs::remove_file; use std::fs::File; use std::io::{stdin, BufRead, BufReader, BufWriter, Read, Write}; use std::path::Path; -use std::{char, fs::remove_file}; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError, UUsageError}; use uucore::parse_size::parse_size; @@ -27,7 +29,7 @@ static OPT_ADDITIONAL_SUFFIX: &str = "additional-suffix"; static OPT_FILTER: &str = "filter"; static OPT_NUMERIC_SUFFIXES: &str = "numeric-suffixes"; static OPT_SUFFIX_LENGTH: &str = "suffix-length"; -static OPT_DEFAULT_SUFFIX_LENGTH: &str = "2"; +static OPT_DEFAULT_SUFFIX_LENGTH: &str = "0"; static OPT_VERBOSE: &str = "verbose"; static ARG_INPUT: &str = "input"; @@ -98,7 +100,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { } } - split(&settings) + split(settings) } pub fn uu_app<'a>() -> App<'a> { @@ -111,8 +113,7 @@ pub fn uu_app<'a>() -> App<'a> { .short('b') .long(OPT_BYTES) .takes_value(true) - .default_value("2") - .help("use suffixes of length N (default 2)"), + .help("put SIZE bytes per output file"), ) .arg( Arg::new(OPT_LINE_BYTES) @@ -231,7 +232,6 @@ impl Strategy { } } -#[allow(dead_code)] struct Settings { prefix: String, numeric_suffix: bool, @@ -241,7 +241,7 @@ struct Settings { /// When supplied, a shell command to output to instead of xaa, xab … filter: Option, strategy: Strategy, - verbose: bool, // TODO: warning: field is never read: `verbose` + verbose: bool, } trait Splitter { @@ -343,39 +343,7 @@ impl Splitter for ByteSplitter { } } -// (1, 3) -> "aab" -#[allow(clippy::many_single_char_names)] -fn str_prefix(i: usize, width: usize) -> String { - let mut c = "".to_owned(); - let mut n = i; - let mut w = width; - while w > 0 { - w -= 1; - let div = 26usize.pow(w as u32); - let r = n / div; - n -= r * div; - c.push(char::from_u32((r as u32) + 97).unwrap()); - } - c -} - -// (1, 3) -> "001" -#[allow(clippy::many_single_char_names)] -fn num_prefix(i: usize, width: usize) -> String { - let mut c = "".to_owned(); - let mut n = i; - let mut w = width; - while w > 0 { - w -= 1; - let div = 10usize.pow(w as u32); - let r = n / div; - n -= r * div; - c.push(char::from_digit(r as u32, 10).unwrap()); - } - c -} - -fn split(settings: &Settings) -> UResult<()> { +fn split(settings: Settings) -> UResult<()> { let mut reader = BufReader::new(if settings.input == "-" { Box::new(stdin()) as Box } else { @@ -395,19 +363,19 @@ fn split(settings: &Settings) -> UResult<()> { } }; + // This object is responsible for creating the filename for each chunk. + let filename_factory = FilenameFactory::new( + settings.prefix, + settings.additional_suffix, + settings.suffix_length, + settings.numeric_suffix, + ); let mut fileno = 0; loop { // Get a new part file set up, and construct `writer` for it. - let mut filename = settings.prefix.clone(); - filename.push_str( - if settings.numeric_suffix { - num_prefix(fileno, settings.suffix_length) - } else { - str_prefix(fileno, settings.suffix_length) - } - .as_ref(), - ); - filename.push_str(settings.additional_suffix.as_ref()); + let filename = filename_factory + .make(fileno) + .ok_or_else(|| USimpleError::new(1, "output file suffixes exhausted"))?; let mut writer = platform::instantiate_current_writer(&settings.filter, filename.as_str()); let bytes_consumed = splitter @@ -429,6 +397,21 @@ fn split(settings: &Settings) -> UResult<()> { break; } + // TODO It is silly to have the "creating file" message here + // after the file has been already created. However, because + // of the way the main loop has been written, an extra file + // gets created and then deleted in the last iteration of the + // loop. So we need to make sure we are not in that case when + // printing this message. + // + // This is only here temporarily while we make some + // improvements to the architecture of the main loop in this + // function. In the future, it will move to a more appropriate + // place---at the point where the file is actually created. + if settings.verbose { + println!("creating file {}", filename.quote()); + } + fileno += 1; } Ok(()) diff --git a/src/uu/stat/Cargo.toml b/src/uu/stat/Cargo.toml index e686b62c8a3..983f65c16e6 100644 --- a/src/uu/stat/Cargo.toml +++ b/src/uu/stat/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_stat" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "stat ~ (uutils) display FILE status" @@ -16,8 +16,8 @@ path = "src/stat.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries", "libc", "fs", "fsext"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "libc", "fs", "fsext"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "stat" diff --git a/src/uu/stdbuf/Cargo.toml b/src/uu/stdbuf/Cargo.toml index 6369d325299..d011adee26c 100644 --- a/src/uu/stdbuf/Cargo.toml +++ b/src/uu/stdbuf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_stdbuf" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "stdbuf ~ (uutils) run COMMAND with modified standard stream buffering" @@ -17,11 +17,11 @@ path = "src/stdbuf.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } tempfile = "3.1" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [build-dependencies] -libstdbuf = { version="0.0.8", package="uu_stdbuf_libstdbuf", path="src/libstdbuf" } +libstdbuf = { version="0.0.9", package="uu_stdbuf_libstdbuf", path="src/libstdbuf" } [[bin]] name = "stdbuf" diff --git a/src/uu/stdbuf/build.rs b/src/uu/stdbuf/build.rs index b03bce849e9..9d36f20f4f1 100644 --- a/src/uu/stdbuf/build.rs +++ b/src/uu/stdbuf/build.rs @@ -28,15 +28,30 @@ fn main() { // - cargo run // - cross run // - cargo install --git + // - cargo publish --dry-run let mut name = target_dir.file_name().unwrap().to_string_lossy(); while name != "target" && !name.starts_with("cargo-install") { target_dir = target_dir.parent().unwrap(); name = target_dir.file_name().unwrap().to_string_lossy(); } - let mut libstdbuf = target_dir.to_path_buf(); - libstdbuf.push(env::var("PROFILE").unwrap()); - libstdbuf.push("deps"); - libstdbuf.push(format!("liblibstdbuf{}", platform::DYLIB_EXT)); + let mut dir = target_dir.to_path_buf(); + dir.push(env::var("PROFILE").unwrap()); + dir.push("deps"); + let mut path = None; - fs::copy(libstdbuf, Path::new(&out_dir).join("libstdbuf.so")).unwrap(); + // When running cargo publish, cargo appends hashes to the filenames of the compiled artifacts. + // Therefore, it won't work to just get liblibstdbuf.so. Instead, we look for files with the + // glob pattern "liblibstdbuf*.so" (i.e. starts with liblibstdbuf and ends with the extension). + for entry in fs::read_dir(dir).unwrap().flatten() { + let name = entry.file_name(); + let name = name.to_string_lossy(); + if name.starts_with("liblibstdbuf") && name.ends_with(platform::DYLIB_EXT) { + path = Some(entry.path()); + } + } + fs::copy( + path.expect("liblibstdbuf was not found"), + Path::new(&out_dir).join("libstdbuf.so"), + ) + .unwrap(); } diff --git a/src/uu/stdbuf/src/libstdbuf/Cargo.toml b/src/uu/stdbuf/src/libstdbuf/Cargo.toml index 069a2ae11cb..71ef95c4ce9 100644 --- a/src/uu/stdbuf/src/libstdbuf/Cargo.toml +++ b/src/uu/stdbuf/src/libstdbuf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_stdbuf_libstdbuf" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "stdbuf/libstdbuf ~ (uutils); dynamic library required for stdbuf" @@ -19,8 +19,8 @@ crate-type = ["cdylib", "rlib"] # XXX: note: the rlib is just to prevent Cargo f [dependencies] cpp = "0.5" libc = "0.2" -uucore = { version=">=0.0.10", package="uucore", path="../../../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../../../uucore_procs" } [build-dependencies] cpp_build = "0.4" diff --git a/src/uu/sum/Cargo.toml b/src/uu/sum/Cargo.toml index fe59eb6ee8a..934b19f79bc 100644 --- a/src/uu/sum/Cargo.toml +++ b/src/uu/sum/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_sum" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "sum ~ (uutils) display checksum and block counts for input" @@ -16,8 +16,8 @@ path = "src/sum.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "sum" diff --git a/src/uu/sync/Cargo.toml b/src/uu/sync/Cargo.toml index 695e3d40f13..bd99d32973a 100644 --- a/src/uu/sync/Cargo.toml +++ b/src/uu/sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_sync" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "sync ~ (uutils) synchronize cache writes to storage" @@ -17,8 +17,8 @@ path = "src/sync.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["wide"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["wide"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "std", "winbase", "winerror"] } [[bin]] diff --git a/src/uu/tac/Cargo.toml b/src/uu/tac/Cargo.toml index c63ed2ff68d..54610ab55f4 100644 --- a/src/uu/tac/Cargo.toml +++ b/src/uu/tac/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "uu_tac" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "tac ~ (uutils) concatenate and display input lines in reverse order" @@ -21,8 +21,8 @@ memchr = "2" memmap2 = "0.5" regex = "1" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "tac" diff --git a/src/uu/tail/Cargo.toml b/src/uu/tail/Cargo.toml index bd8a3603a45..ea93790d82a 100644 --- a/src/uu/tail/Cargo.toml +++ b/src/uu/tail/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_tail" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "tail ~ (uutils) display the last lines of input" @@ -17,8 +17,8 @@ path = "src/tail.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["ringbuffer"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(windows)'.dependencies] winapi = { version="0.3", features=["fileapi", "handleapi", "processthreadsapi", "synchapi", "winbase"] } diff --git a/src/uu/tee/Cargo.toml b/src/uu/tee/Cargo.toml index 9de6f22bee8..fc319875e11 100644 --- a/src/uu/tee/Cargo.toml +++ b/src/uu/tee/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_tee" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "tee ~ (uutils) display input and copy to FILE" @@ -18,8 +18,8 @@ path = "src/tee.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" retain_mut = "=0.1.2" # ToDO: [2021-01-01; rivy; maint/MinSRV] ~ v0.1.5 uses const generics which aren't stabilized until rust v1.51.0 -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["libc"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "tee" diff --git a/src/uu/test/Cargo.toml b/src/uu/test/Cargo.toml index 1fe0e1c15b0..c0e44e34076 100644 --- a/src/uu/test/Cargo.toml +++ b/src/uu/test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_test" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "test ~ (uutils) evaluate comparison and file type expressions" @@ -17,8 +17,8 @@ path = "src/test.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(target_os = "redox")'.dependencies] redox_syscall = "0.2" diff --git a/src/uu/timeout/Cargo.toml b/src/uu/timeout/Cargo.toml index 18419501834..8a8b564e4de 100644 --- a/src/uu/timeout/Cargo.toml +++ b/src/uu/timeout/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_timeout" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "timeout ~ (uutils) run COMMAND with a DURATION time limit" @@ -18,8 +18,8 @@ path = "src/timeout.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" nix = "0.23.1" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["process", "signals"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["process", "signals"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] diff --git a/src/uu/touch/Cargo.toml b/src/uu/touch/Cargo.toml index 947d3cbfbc6..276a45d339e 100644 --- a/src/uu/touch/Cargo.toml +++ b/src/uu/touch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_touch" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "touch ~ (uutils) change FILE timestamps" @@ -18,8 +18,8 @@ path = "src/touch.rs" filetime = "0.2.1" clap = { version = "3.0", features = ["wrap_help", "cargo"] } time = "0.1.40" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["libc"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "touch" diff --git a/src/uu/tr/Cargo.toml b/src/uu/tr/Cargo.toml index b382a5482ac..1404e09c69e 100644 --- a/src/uu/tr/Cargo.toml +++ b/src/uu/tr/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_tr" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "tr ~ (uutils) translate characters within input and display" @@ -18,8 +18,8 @@ path = "src/tr.rs" bit-set = "0.5.0" fnv = "1.0.5" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "tr" diff --git a/src/uu/true/Cargo.toml b/src/uu/true/Cargo.toml index deb9defb36d..9b117568539 100644 --- a/src/uu/true/Cargo.toml +++ b/src/uu/true/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_true" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "true ~ (uutils) do nothing and succeed" @@ -16,8 +16,8 @@ path = "src/true.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "true" diff --git a/src/uu/truncate/Cargo.toml b/src/uu/truncate/Cargo.toml index 9d5a3e10d88..bfd11053e08 100644 --- a/src/uu/truncate/Cargo.toml +++ b/src/uu/truncate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_truncate" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "truncate ~ (uutils) truncate (or extend) FILE to SIZE" @@ -16,8 +16,8 @@ path = "src/truncate.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "truncate" diff --git a/src/uu/tsort/Cargo.toml b/src/uu/tsort/Cargo.toml index 8f74b7d17b2..221e948764b 100644 --- a/src/uu/tsort/Cargo.toml +++ b/src/uu/tsort/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_tsort" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "tsort ~ (uutils) topologically sort input (partially ordered) pairs" @@ -16,8 +16,8 @@ path = "src/tsort.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "tsort" diff --git a/src/uu/tty/Cargo.toml b/src/uu/tty/Cargo.toml index 2724e1b0f01..77e65c4c186 100644 --- a/src/uu/tty/Cargo.toml +++ b/src/uu/tty/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_tty" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "tty ~ (uutils) display the name of the terminal connected to standard input" @@ -18,8 +18,8 @@ path = "src/tty.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } libc = "0.2.42" atty = "0.2" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["fs"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "tty" diff --git a/src/uu/uname/Cargo.toml b/src/uu/uname/Cargo.toml index 17aab2de9bd..6db69f0b865 100644 --- a/src/uu/uname/Cargo.toml +++ b/src/uu/uname/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_uname" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "uname ~ (uutils) display system information" @@ -17,8 +17,8 @@ path = "src/uname.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } platform-info = "0.2" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "uname" diff --git a/src/uu/unexpand/Cargo.toml b/src/uu/unexpand/Cargo.toml index 9318b5cd94f..481a89c27df 100644 --- a/src/uu/unexpand/Cargo.toml +++ b/src/uu/unexpand/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_unexpand" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "unexpand ~ (uutils) convert input spaces to tabs" @@ -17,8 +17,8 @@ path = "src/unexpand.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } unicode-width = "0.1.5" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "unexpand" diff --git a/src/uu/uniq/Cargo.toml b/src/uu/uniq/Cargo.toml index e415ceb3bce..53fc73460b8 100644 --- a/src/uu/uniq/Cargo.toml +++ b/src/uu/uniq/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_uniq" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "uniq ~ (uutils) filter identical adjacent lines from input" @@ -18,8 +18,8 @@ path = "src/uniq.rs" clap = { version = "3.0", features = ["wrap_help", "cargo"] } strum = "0.21" strum_macros = "0.21" -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "uniq" diff --git a/src/uu/unlink/Cargo.toml b/src/uu/unlink/Cargo.toml index 1bf49568bb5..d49c0518a1e 100644 --- a/src/uu/unlink/Cargo.toml +++ b/src/uu/unlink/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_unlink" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "unlink ~ (uutils) remove a (file system) link to FILE" @@ -16,8 +16,8 @@ path = "src/unlink.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore" } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore" } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "unlink" diff --git a/src/uu/uptime/Cargo.toml b/src/uu/uptime/Cargo.toml index 60b176c3772..d9764a7d96b 100644 --- a/src/uu/uptime/Cargo.toml +++ b/src/uu/uptime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_uptime" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "uptime ~ (uutils) display dynamic system information" @@ -15,10 +15,10 @@ edition = "2018" path = "src/uptime.rs" [dependencies] -chrono = "0.4" +chrono = "^0.4.11" clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["libc", "utmpx"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["libc", "utmpx"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "uptime" diff --git a/src/uu/users/Cargo.toml b/src/uu/users/Cargo.toml index b75c5db62ea..44972619777 100644 --- a/src/uu/users/Cargo.toml +++ b/src/uu/users/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_users" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "users ~ (uutils) display names of currently logged-in users" @@ -16,8 +16,8 @@ path = "src/users.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["utmpx"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["utmpx"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "users" diff --git a/src/uu/wc/Cargo.toml b/src/uu/wc/Cargo.toml index 5c0265eb71d..93c827be3b3 100644 --- a/src/uu/wc/Cargo.toml +++ b/src/uu/wc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_wc" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "wc ~ (uutils) display newline, word, and byte counts for input" @@ -16,8 +16,8 @@ path = "src/wc.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["pipes"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["pipes"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } bytecount = "0.6.2" utf-8 = "0.7.6" unicode-width = "0.1.8" diff --git a/src/uu/who/Cargo.toml b/src/uu/who/Cargo.toml index 6b9e7d9a95a..14a4638b315 100644 --- a/src/uu/who/Cargo.toml +++ b/src/uu/who/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_who" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "who ~ (uutils) display information about currently logged-in users" @@ -15,9 +15,9 @@ edition = "2018" path = "src/who.rs" [dependencies] -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["utmpx"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } clap = { version = "3.0", features = ["wrap_help", "cargo"] } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["utmpx"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [[bin]] name = "who" diff --git a/src/uu/whoami/Cargo.toml b/src/uu/whoami/Cargo.toml index ff6842c356a..37dc61e4dba 100644 --- a/src/uu/whoami/Cargo.toml +++ b/src/uu/whoami/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_whoami" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "whoami ~ (uutils) display user name of current effective user ID" @@ -16,8 +16,8 @@ path = "src/whoami.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["entries"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(target_os = "windows")'.dependencies] winapi = { version = "0.3", features = ["lmcons"] } diff --git a/src/uu/yes/Cargo.toml b/src/uu/yes/Cargo.toml index b5eaa0ad6c4..f19fff3e32a 100644 --- a/src/uu/yes/Cargo.toml +++ b/src/uu/yes/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uu_yes" -version = "0.0.8" +version = "0.0.9" authors = ["uutils developers"] license = "MIT" description = "yes ~ (uutils) repeatedly display a line with STRING (or 'y')" @@ -16,8 +16,8 @@ path = "src/yes.rs" [dependencies] clap = { version = "3.0", features = ["wrap_help", "cargo"] } -uucore = { version=">=0.0.10", package="uucore", path="../../uucore", features=["pipes"] } -uucore_procs = { version=">=0.0.7", package="uucore_procs", path="../../uucore_procs" } +uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["pipes"] } +uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" } [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] nix = "0.23.1" diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index 3099952ff89..1fbf06b7701 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uucore" -version = "0.0.10" +version = "0.0.11" authors = ["uutils developers"] license = "MIT" description = "uutils ~ 'core' uutils code library (cross-platform)" diff --git a/src/uucore/src/lib/mods/backup_control.rs b/src/uucore/src/lib/mods/backup_control.rs index eedb4991c7f..2d1e4c4d5c0 100644 --- a/src/uucore/src/lib/mods/backup_control.rs +++ b/src/uucore/src/lib/mods/backup_control.rs @@ -56,7 +56,7 @@ //! .get_matches_from(vec![ //! "app", "--backup=t", "--suffix=bak~" //! ]); -//! +//! //! let backup_mode = match backup_control::determine_backup_mode(&matches) { //! Err(e) => { //! show!(e); @@ -321,7 +321,7 @@ pub fn determine_backup_suffix(matches: &ArgMatches) -> String { /// .get_matches_from(vec![ /// "app", "-b", "--backup=n" /// ]); -/// +/// /// let backup_mode = backup_control::determine_backup_mode(&matches); /// /// assert!(backup_mode.is_err()); diff --git a/src/uucore_procs/Cargo.toml b/src/uucore_procs/Cargo.toml index 3efe80e00d8..9505a8ba425 100644 --- a/src/uucore_procs/Cargo.toml +++ b/src/uucore_procs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uucore_procs" -version = "0.0.7" +version = "0.0.8" authors = ["Roy Ivy III "] license = "MIT" description = "uutils ~ 'uucore' proc-macros" diff --git a/tests/by-util/test_join.rs b/tests/by-util/test_join.rs index 1d92bf8e724..4b2d1bbbaee 100644 --- a/tests/by-util/test_join.rs +++ b/tests/by-util/test_join.rs @@ -328,3 +328,31 @@ fn single_file_with_header() { .succeeds() .stdout_is("A 1\n"); } + +#[test] +fn non_line_feeds() { + new_ucmd!() + .arg("non-line_feeds_1.txt") + .arg("non-line_feeds_2.txt") + .succeeds() + .stdout_only_fixture("non-line_feeds.expected"); +} + +#[test] +fn non_unicode() { + new_ucmd!() + .arg("non-unicode_1.bin") + .arg("non-unicode_2.bin") + .succeeds() + .stdout_only_fixture("non-unicode.expected"); +} + +#[test] +fn null_line_endings() { + new_ucmd!() + .arg("-z") + .arg("non-unicode_1.bin") + .arg("non-unicode_2.bin") + .succeeds() + .stdout_only_fixture("z.expected"); +} diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index cf266db89c7..b5d49337ded 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -56,8 +56,70 @@ fn test_ls_ordering() { .stdout_matches(&Regex::new("some-dir1:\\ntotal 0").unwrap()); } +//#[cfg(all(feature = "mknod"))] +#[test] +fn test_ls_devices() { + let scene = TestScenario::new(util_name!()); + let at = &scene.fixtures; + at.mkdir("some-dir1"); + + // Regex tests correct device ID and correct (no pad) spacing for a single file + #[cfg(any(target_os = "macos", target_os = "ios"))] + { + scene + .ucmd() + .arg("-al") + .arg("/dev/null") + .succeeds() + .stdout_matches(&Regex::new("[^ ] 3, 2 [^ ]").unwrap()); + } + + #[cfg(target_os = "linux")] + { + scene + .ucmd() + .arg("-al") + .arg("/dev/null") + .succeeds() + .stdout_matches(&Regex::new("[^ ] 1, 3 [^ ]").unwrap()); + } + + // Regex tests alignment against a file (stdout is a link to a tty) + #[cfg(unix)] + { + let res = scene + .ucmd() + .arg("-alL") + .arg("/dev/null") + .arg("/dev/stdout") + .succeeds(); + + let null_len = String::from_utf8(res.stdout().to_owned()) + .ok() + .unwrap() + .lines() + .next() + .unwrap() + .strip_suffix("/dev/null") + .unwrap() + .len(); + + let stdout_len = String::from_utf8(res.stdout().to_owned()) + .ok() + .unwrap() + .lines() + .nth(1) + .unwrap() + .strip_suffix("/dev/stdout") + .unwrap() + .len(); + + assert_eq!(stdout_len, null_len); + } +} + +#[cfg(all(feature = "chmod"))] #[test] -#[cfg(feature = "chmod")] fn test_ls_io_errors() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -2457,6 +2519,36 @@ fn test_ls_dangling_symlinks() { .arg("temp_dir") .fails() .stdout_contains("l?????????"); + + #[cfg(unix)] + { + // Check padding is the same for real files and dangling links, in non-long formats + at.touch("temp_dir/real_file"); + + let real_file_res = scene.ucmd().arg("-Li1").arg("temp_dir").fails(); + let real_file_stdout_len = String::from_utf8(real_file_res.stdout().to_owned()) + .ok() + .unwrap() + .lines() + .nth(1) + .unwrap() + .strip_suffix("real_file") + .unwrap() + .len(); + + let dangle_file_res = scene.ucmd().arg("-Li1").arg("temp_dir").fails(); + let dangle_stdout_len = String::from_utf8(dangle_file_res.stdout().to_owned()) + .ok() + .unwrap() + .lines() + .next() + .unwrap() + .strip_suffix("dangle") + .unwrap() + .len(); + + assert_eq!(real_file_stdout_len, dangle_stdout_len); + } } #[test] diff --git a/tests/by-util/test_sort.rs b/tests/by-util/test_sort.rs index 4a79d8557f3..d472d4b5e9c 100644 --- a/tests/by-util/test_sort.rs +++ b/tests/by-util/test_sort.rs @@ -340,10 +340,10 @@ fn test_dictionary_order() { fn test_dictionary_order2() { for non_dictionary_order2_param in &["-d"] { new_ucmd!() - .pipe_in("a👦🏻aa b\naaaa b") // spell-checker:disable-line + .pipe_in("a👦🏻aa\tb\naaaa\tb") // spell-checker:disable-line .arg(non_dictionary_order2_param) // spell-checker:disable-line .succeeds() - .stdout_only("a👦🏻aa b\naaaa b\n"); // spell-checker:disable-line + .stdout_only("a👦🏻aa\tb\naaaa\tb\n"); // spell-checker:disable-line } } diff --git a/tests/by-util/test_split.rs b/tests/by-util/test_split.rs index 229925a1c81..ebcc0926dc5 100644 --- a/tests/by-util/test_split.rs +++ b/tests/by-util/test_split.rs @@ -2,7 +2,7 @@ // * // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. - +// spell-checker:ignore xzaaa sixhundredfiftyonebytes ninetyonebytes asciilowercase extern crate rand; extern crate regex; @@ -16,7 +16,7 @@ use std::io::Write; use std::path::Path; use std::{ fs::{read_dir, File}, - io::BufWriter, + io::{BufWriter, Read}, }; fn random_chars(n: usize) -> String { @@ -340,3 +340,87 @@ fn test_split_invalid_bytes_size() { } } } + +fn file_read(at: &AtPath, filename: &str) -> String { + let mut s = String::new(); + at.open(filename).read_to_string(&mut s).unwrap(); + s +} + +// TODO Use char::from_digit() in Rust v1.51.0 or later. +fn char_from_digit(n: usize) -> char { + (b'a' + n as u8) as char +} + +/// Test for the default suffix length behavior: dynamically increasing size. +#[test] +fn test_alphabetic_dynamic_suffix_length() { + let (at, mut ucmd) = at_and_ucmd!(); + // Split into chunks of one byte each. + // + // The input file has (26^2) - 26 + 1 = 651 bytes. This is just + // enough to force `split` to dynamically increase the length of + // the filename for the very last chunk. + // + // We expect the output files to be named + // + // xaa, xab, xac, ..., xyx, xyy, xyz, xzaaa + // + ucmd.args(&["-b", "1", "sixhundredfiftyonebytes.txt"]) + .succeeds(); + for i in 0..25 { + for j in 0..26 { + let filename = format!("x{}{}", char_from_digit(i), char_from_digit(j),); + let contents = file_read(&at, &filename); + assert_eq!(contents, "a"); + } + } + assert_eq!(file_read(&at, "xzaaa"), "a"); +} + +/// Test for the default suffix length behavior: dynamically increasing size. +#[test] +fn test_numeric_dynamic_suffix_length() { + let (at, mut ucmd) = at_and_ucmd!(); + // Split into chunks of one byte each, use numbers instead of + // letters as file suffixes. + // + // The input file has (10^2) - 10 + 1 = 91 bytes. This is just + // enough to force `split` to dynamically increase the length of + // the filename for the very last chunk. + // + // x00, x01, x02, ..., x87, x88, x89, x9000 + // + ucmd.args(&["-d", "-b", "1", "ninetyonebytes.txt"]) + .succeeds(); + for i in 0..90 { + let filename = format!("x{:02}", i); + let contents = file_read(&at, &filename); + assert_eq!(contents, "a"); + } + assert_eq!(file_read(&at, "x9000"), "a"); +} + +#[test] +fn test_suffixes_exhausted() { + new_ucmd!() + .args(&["-b", "1", "-a", "1", "asciilowercase.txt"]) + .fails() + .stderr_only("split: output file suffixes exhausted"); +} + +#[test] +fn test_verbose() { + new_ucmd!() + .args(&["-b", "5", "--verbose", "asciilowercase.txt"]) + .succeeds() + .stdout_only( + "creating file 'xaa' +creating file 'xab' +creating file 'xac' +creating file 'xad' +creating file 'xae' +creating file 'xaf' +", + ); +} diff --git a/tests/by-util/test_tee.rs b/tests/by-util/test_tee.rs index f2587a11fc9..0f41d7db700 100644 --- a/tests/by-util/test_tee.rs +++ b/tests/by-util/test_tee.rs @@ -63,9 +63,7 @@ fn test_tee_append() { fn test_tee_no_more_writeable_1() { // equals to 'tee /dev/full out2 (); + let content = (1..=10).map(|x| format!("{}\n", x)).collect::(); let file_out = "tee_file_out"; ucmd.arg("/dev/full") @@ -85,9 +83,7 @@ fn test_tee_no_more_writeable_2() { // but currently there is no way to redirect stdout to /dev/full // so this test is disabled let (_at, mut ucmd) = at_and_ucmd!(); - let _content = (1..=10) - .map(|x| format!("{}\n", x.to_string())) - .collect::(); + let _content = (1..=10).map(|x| format!("{}\n", x)).collect::(); let file_out_a = "tee_file_out_a"; let file_out_b = "tee_file_out_b"; diff --git a/tests/common/util.rs b/tests/common/util.rs index ffca7d9b23c..5df0b753ff0 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -1230,14 +1230,7 @@ pub fn check_coreutil_version( .output() { Ok(s) => s, - Err(e) => { - return Err(format!( - "{}: '{}' {}", - UUTILS_WARNING, - util_name, - e.to_string() - )) - } + Err(e) => return Err(format!("{}: '{}' {}", UUTILS_WARNING, util_name, e)), }; std::str::from_utf8(&version_check.stdout).unwrap() .split('\n') @@ -1247,7 +1240,7 @@ pub fn check_coreutil_version( || Err(format!("{}: unexpected output format for reference coreutil: '{} --version'", UUTILS_WARNING, util_name)), |s| { if s.contains(&format!("(GNU coreutils) {}", version_expected)) { - Ok(format!("{}: {}", UUTILS_INFO, s.to_string())) + Ok(format!("{}: {}", UUTILS_INFO, s)) } else if s.contains("(GNU coreutils)") { let version_found = parse_coreutil_version(s); let version_expected = version_expected.parse::().unwrap_or_default(); diff --git a/tests/fixtures/join/non-line_feeds.expected b/tests/fixtures/join/non-line_feeds.expected new file mode 100644 index 00000000000..c4cb5b448f5 --- /dev/null +++ b/tests/fixtures/join/non-line_feeds.expected @@ -0,0 +1,2 @@ + b d +a c f diff --git a/tests/fixtures/join/non-line_feeds_1.txt b/tests/fixtures/join/non-line_feeds_1.txt new file mode 100644 index 00000000000..f3e0c0732f1 --- /dev/null +++ b/tests/fixtures/join/non-line_feeds_1.txt @@ -0,0 +1,2 @@ + b +a c diff --git a/tests/fixtures/join/non-line_feeds_2.txt b/tests/fixtures/join/non-line_feeds_2.txt new file mode 100644 index 00000000000..0a5301e1350 --- /dev/null +++ b/tests/fixtures/join/non-line_feeds_2.txt @@ -0,0 +1,2 @@ + d +a f diff --git a/tests/fixtures/join/non-unicode.expected b/tests/fixtures/join/non-unicode.expected new file mode 100644 index 00000000000..7c2e0d9aff2 Binary files /dev/null and b/tests/fixtures/join/non-unicode.expected differ diff --git a/tests/fixtures/join/non-unicode_1.bin b/tests/fixtures/join/non-unicode_1.bin new file mode 100644 index 00000000000..e264bd505fb Binary files /dev/null and b/tests/fixtures/join/non-unicode_1.bin differ diff --git a/tests/fixtures/join/non-unicode_2.bin b/tests/fixtures/join/non-unicode_2.bin new file mode 100644 index 00000000000..6b336c66950 Binary files /dev/null and b/tests/fixtures/join/non-unicode_2.bin differ diff --git a/tests/fixtures/join/z.expected b/tests/fixtures/join/z.expected new file mode 100644 index 00000000000..ed85bb05393 Binary files /dev/null and b/tests/fixtures/join/z.expected differ diff --git a/tests/fixtures/split/asciilowercase.txt b/tests/fixtures/split/asciilowercase.txt new file mode 100644 index 00000000000..b0883f382e1 --- /dev/null +++ b/tests/fixtures/split/asciilowercase.txt @@ -0,0 +1 @@ +abcdefghijklmnopqrstuvwxyz diff --git a/tests/fixtures/split/ninetyonebytes.txt b/tests/fixtures/split/ninetyonebytes.txt new file mode 100644 index 00000000000..62049a6b3e7 --- /dev/null +++ b/tests/fixtures/split/ninetyonebytes.txt @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/tests/fixtures/split/sixhundredfiftyonebytes.txt b/tests/fixtures/split/sixhundredfiftyonebytes.txt new file mode 100644 index 00000000000..f16b32e853d --- /dev/null +++ b/tests/fixtures/split/sixhundredfiftyonebytes.txt @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/util/test-repo-whitespace.BAT b/util/test-repo-whitespace.BAT index c63415295bf..6e2fce5574e 100644 --- a/util/test-repo-whitespace.BAT +++ b/util/test-repo-whitespace.BAT @@ -1,19 +1,21 @@ @setLocal @echo off -:: `test-repo-whitespace [DIR]...` +:: `test-repo-whitespace [DIR]...` v2022.01.01 :: style inspector ~ whitespace: find nonconforming files in repository -:: Copyright (C) 2016-2020 ~ Roy Ivy III +:: Copyright (C) 2016-2022 ~ Roy Ivy III :: License: MIT/Apache-2.0 (see https://opensource.org/licenses/Apache-2.0 , https://opensource.org/licenses/MIT) :: * this software is provided for free, WITHOUT ANY EXPRESS OR IMPLIED WARRANTY (see the license for details) -:: spell-checker:ignore (ignore) CTYPE POSIX RETval RETvar akefile makefile makefiles multiline :: spell-checker:ignore (shell/cmd) COMSPEC ERRORLEVEL +:: spell-checker:ignore () CTYPE POSIX Tval Tvar akefile makefile makefiles multiline testdata :config -set "_exclude_dir=(?i)[_.#]build|[.]git|[.]gpg|[.]vs|fixtures|vendor" -set "_exclude=(?i)[.](cache|dll|exe|gif|gz|zip)$" +set "_exclude_dirs_rx=(?i)[_.#]build|[.]git|[.]gpg|[.]obj|[.]vs|fixtures|node_modules|target|testdata|test-resources|vendor" +set "_exclude_files_rx=(?i)[.](cache|dll|exe|gif|gz|ico|png|zip)$" +set "_crlf_files_rx=(?i)[.](bat|cmd|csv)$" +set "_tabbed_files_rx=(?i)^^(.*[.]go|go[.](mod|sum)|(GNU)?[Mm]akefile([.].*)?)$" :config_done set _dp0=%~dp0. @@ -34,36 +36,36 @@ if /i "%LC_CTYPE%"=="posix" (set "LC_CTYPE=C") &:: `pcregrep` doesn't understand set "ERRORLEVEL=" set "ERROR=" :: 1. Test for TABs within leading whitespace (except go files makefiles) -"%PCREGREP%" -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" --exclude "(?i)[.]go$" --exclude "go[.](mod|sum)" --exclude "(GNU)?[Mm]akefile([.].*)?" --count --files-with-matches --recursive "^\s*\t" %dirs% +"%PCREGREP%" -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" --exclude "%_tabbed_files_rx%" --count --files-with-matches --recursive "^\s*\t" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set ERROR=1 & echo ERROR: files found with TABs within leading whitespace [file:#lines_matched]) :: 2. Test for lines with internal TABs -"%PCREGREP%" -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" --count --files-with-matches --recursive "^.*[^\t]\t" %dirs% +"%PCREGREP%" -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" --count --files-with-matches --recursive "^.*[^\t]\t" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set ERROR=1 & echo ERROR: files found with lines containing internal TABs [file:#lines_matched]) :: 3. Test that makefiles have ONLY initial-TAB leading whitespace -"%PCREGREP%" -I --exclude-dir "%_exclude_dir%" --include "(GNU)?[Mm]akefile([.].*)?" --exclude "[.](to|y)ml$" --recursive --line-number --invert-match "^([\t]\s*\S|\S|$)" %dirs% +"%PCREGREP%" -I --exclude-dir "%_exclude_dirs_rx%" --include "(GNU)?[Mm]akefile([.].*)?" --exclude "[.](to|y)ml$" --recursive --line-number --invert-match "^([\t]\s*\S|\S|$)" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set ERROR=1 & echo ERROR: Makefiles found with lines having non-TAB leading whitespace [file:line_number]) :: 4. Test for non-LF line endings set "HAVE_NonLF_ERROR=" -"%PCREGREP%" --buffer-size=1M -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" -NLF --files-with-matches --multiline --recursive "\r[^\n]" %dirs% +"%PCREGREP%" --buffer-size=1M -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" -NLF --files-with-matches --multiline --recursive "\r[^\n]" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set HAVE_NonLF_ERROR=1 & echo ## files found with CR line endings) -"%PCREGREP%" --buffer-size=1M -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" --exclude "(?i)\.bat$|\.cmd$" -NLF --files-with-matches --multiline --recursive "\r\n" %dirs% +"%PCREGREP%" --buffer-size=1M -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" --exclude "%_crlf_files_rx%" -NLF --files-with-matches --multiline --recursive "\r\n" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set HAVE_NonLF_ERROR=1 & echo ## files found with CRLF line endings) if DEFINED HAVE_NonLF_ERROR ( set ERROR=1 & echo ERROR: files found with non-LF line endings) :: 5. Test for files without trailing newline -:: "%PCREGREP%" -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" --files-without-match --multiline --recursive "\r?[\r\n]\z" %dirs% -"%PCREGREP%" -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" --files-with-matches --multiline --recursive "\z" %dirs% +:: "%PCREGREP%" -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" --files-without-match --multiline --recursive "\r?[\r\n]\z" %dirs% +"%PCREGREP%" -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" --files-with-matches --multiline --recursive "\z" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set ERROR=1 & echo ERROR: files found without trailing newline) :: 6. Test for files with lines having trailing whitespace -"%PCREGREP%" -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" --recursive --line-number "\s$" %dirs% +"%PCREGREP%" -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" --recursive --line-number "\s$" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set ERROR=1 & echo ERROR: files found with lines having trailing whitespace [file:line_number]) :: 7. Test for files with BOM -"%PCREGREP%" -I --exclude-dir "%_exclude_dir%" --exclude "%_exclude%" --files-with-matches --multiline --recursive "\A[\xEF][\xBB][\xBF]" %dirs% +"%PCREGREP%" -I --exclude-dir "%_exclude_dirs_rx%" --exclude "%_exclude_files_rx%" --files-with-matches --multiline --recursive "\A[\xEF][\xBB][\xBF]" %dirs% if NOT "%ERRORLEVEL%" == "1" ( set ERROR=1 & echo ERROR: files found with leading BOM) :script_done diff --git a/util/update-version.sh b/util/update-version.sh index cbb811300cc..503f65e5231 100755 --- a/util/update-version.sh +++ b/util/update-version.sh @@ -2,15 +2,23 @@ # This is a stupid helper. I will mass replace all versions (including other crates) # So, it should be triple-checked - -FROM="0.0.7" -TO="0.0.8" - -UUCORE_PROCS_FROM="0.0.6" -UUCORE_PROCS_TO="0.0.7" - -UUCORE_FROM="0.0.9" -UUCORE_TO="0.0.10" +# How to ship a new release: +# 1) update this script +# 2) run it: bash util/update-version.sh +# 3) Do a spot check with "git diff" +# 4) cargo test --release --features unix +# 5) Run util/publish.sh in dry mode (it will fail as packages needs more recent version of uucore) +# 6) Run util/publish.sh --do-it +# 7) In some cases, you might have to fix dependencies and run import + +FROM="0.0.8" +TO="0.0.9" + +UUCORE_PROCS_FROM="0.0.7" +UUCORE_PROCS_TO="0.0.8" + +UUCORE_FROM="0.0.10" +UUCORE_TO="0.0.11" PROGS=$(ls -1d src/uu/*/Cargo.toml src/uu/stdbuf/src/libstdbuf/Cargo.toml Cargo.toml src/uu/base64/Cargo.toml)