diff --git a/Cargo.lock b/Cargo.lock index c48920c0..8951c76d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -131,9 +131,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.59" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" +checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1" dependencies = [ "proc-macro2", "quote", @@ -146,7 +146,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -159,24 +159,24 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.5.4", + "miniz_oxide", "object", "rustc-demangle", ] [[package]] name = "base64" -version = "0.13.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bitflags" @@ -192,9 +192,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" @@ -210,9 +210,9 @@ checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cc" -version = "1.0.77" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -332,25 +332,24 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" dependencies = [ "crossbeam-utils", ] [[package]] name = "console" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" +checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" dependencies = [ "encode_unicode", "lazy_static", "libc", - "terminal_size", "unicode-width", - "winapi", + "windows-sys", ] [[package]] @@ -379,9 +378,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" dependencies = [ "cc", "cxxbridge-flags", @@ -391,9 +390,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" dependencies = [ "cc", "codespan-reporting", @@ -406,15 +405,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" +checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" [[package]] name = "cxxbridge-macro" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" dependencies = [ "proc-macro2", "quote", @@ -490,9 +489,9 @@ checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encode_unicode" @@ -557,9 +556,9 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ "cfg-if", "libc", @@ -574,7 +573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", - "miniz_oxide 0.6.2", + "miniz_oxide", ] [[package]] @@ -709,15 +708,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" @@ -771,6 +770,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.4.3" @@ -846,9 +854,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", @@ -930,15 +938,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.1" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "js-sys" @@ -957,15 +965,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.138" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "link-cplusplus" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] @@ -1041,15 +1049,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.6.2" @@ -1096,6 +1095,15 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + [[package]] name = "notify-rust" version = "4.5.10" @@ -1141,11 +1149,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] @@ -1186,18 +1194,18 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "ordered-multimap" @@ -1255,9 +1263,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" dependencies = [ "cfg-if", "libc", @@ -1299,9 +1307,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "polling" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166ca89eb77fd403230b9c156612965a81e094ec6ec3aa13663d4c8b113fa748" +checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" dependencies = [ "autocfg", "cfg-if", @@ -1319,13 +1327,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" dependencies = [ "once_cell", - "thiserror", - "toml", + "toml_edit", ] [[package]] @@ -1354,9 +1361,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" dependencies = [ "unicode-ident", ] @@ -1381,9 +1388,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -1475,9 +1482,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" dependencies = [ "base64", "bytes", @@ -1551,9 +1558,9 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -1563,24 +1570,24 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ "base64", ] [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "same-file" @@ -1599,9 +1606,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" [[package]] name = "sct" @@ -1636,24 +1643,24 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" [[package]] name = "serde" -version = "1.0.149" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.149" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -1662,9 +1669,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", @@ -1673,9 +1680,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" dependencies = [ "proc-macro2", "quote", @@ -1830,9 +1837,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -1877,23 +1884,13 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "textwrap" version = "0.15.2" @@ -1902,18 +1899,18 @@ checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -1984,9 +1981,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.18.4" +version = "1.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bfb875c82dc0a4f1f37a30e720dee181a2b3a06a428b0fc6873ea38d6407850" +checksum = "0e050c618355082ae5a89ec63bbf897225d5ffe84c7c4e036874e4d185a5044e" dependencies = [ "bytes", "libc", @@ -2026,16 +2023,33 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" + +[[package]] +name = "toml_edit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b" +dependencies = [ + "indexmap", + "nom8", + "toml_datetime", +] + [[package]] name = "topgrade" -version = "10.2.4" +version = "10.2.5" dependencies = [ "cfg-if", "chrono", @@ -2154,9 +2168,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "uds_windows" @@ -2170,15 +2184,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" @@ -2357,9 +2371,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] @@ -2440,19 +2454,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc 0.42.1", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_msvc" @@ -2462,9 +2476,9 @@ checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_i686_gnu" @@ -2474,9 +2488,9 @@ checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_msvc" @@ -2486,9 +2500,9 @@ checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_x86_64_gnu" @@ -2498,15 +2512,15 @@ checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_msvc" @@ -2516,9 +2530,9 @@ checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "winreg" @@ -2593,9 +2607,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c737644108627748a660d038974160e0cbb62605536091bdfa28fd7f64d43c8" +checksum = "f34f314916bd89bdb9934154627fab152f4f28acdda03e7c4c68181b214fe7e3" dependencies = [ "serde", "static_assertions", @@ -2617,9 +2631,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8c89c183461e11867ded456db252eae90874bc6769b7adbea464caa777e51" +checksum = "576cc41e65c7f283e5460f5818073e68fb1f1631502b969ef228c2e03c862efb" dependencies = [ "byteorder", "enumflags2", @@ -2631,9 +2645,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155247a5d1ab55e335421c104ccd95d64f17cebbd02f50cdbc1c33385f9c4d81" +checksum = "0fd4aafc0dee96ae7242a24249ce9babf21e1562822f03df650d4e68c20e41ed" dependencies = [ "proc-macro-crate", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 2da157f4..021091ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ keywords = ["upgrade", "update"] license = "GPL-3.0" # license-file = "LICENSE" repository = "https://github.com/topgrade-rs/topgrade" -version = "10.2.4" +version = "10.2.5" authors = ["Roey Darwish Dror ", "Thomas Schönauer "] exclude = ["doc/screenshot.gif"] edition = "2021" diff --git a/config.example.toml b/config.example.toml index d4fe9403..ef155cb2 100644 --- a/config.example.toml +++ b/config.example.toml @@ -44,6 +44,9 @@ # Skip sending a notification at the end of a run #skip_notify = true +# Skip the preamble displayed when topgrade is run +#display_preamble = false + [git] #max_concurrency = 5 # Additional git repositories to pull @@ -74,7 +77,7 @@ #autoremove = true [linux] -# Arch Package Manager to use. Allowed values: autodetect, trizen, aura, paru, yay, pikaur, pacman, pamac. +# Arch Package Manager to use. Allowed values: autodetect, aura, garuda_update, pacman, pamac, paru, pikaur, trizen, yay. #arch_package_manager = "pacman" # Arguments to pass yay (or paru) when updating packages #yay_arguments = "--nodevel" @@ -82,6 +85,7 @@ #dnf_arguments = "--refresh" #aura_aur_arguments = "-kx" #aura_pacman_arguments = "" +#garuda_update_arguments = "" #show_arch_news = true #trizen_arguments = "--devel" #pikaur_arguments = "" @@ -91,11 +95,18 @@ #emerge_update_flags = "-uDNa --with-bdeps=y world" #redhat_distro_sync = false #rpm_ostree = false +#nix_arguments = "--flake" + +[python] +#enable_pip_review = true ###disabled by default +#enable_pipupgrade = true ###disabled by default [windows] # Manually select Windows updates #accept_all_updates = false #open_remotes_in_new_terminal = true +#wsl_update_pre_release = true +#wsl_update_use_web_download = true # Causes Topgrade to rename itself during the run to allow package managers # to upgrade it. Use this only if you installed Topgrade by using a package diff --git a/src/config.rs b/src/config.rs index 62cad407..84223e06 100644 --- a/src/config.rs +++ b/src/config.rs @@ -71,6 +71,7 @@ type Commands = BTreeMap; #[serde(rename_all = "snake_case")] #[strum(serialize_all = "snake_case")] pub enum Step { + AM, Asdf, Atom, Bin, @@ -89,6 +90,7 @@ pub enum Step { DebGet, Deno, Distrobox, + DkpPacman, Dotnet, Emacs, Firmware, @@ -123,6 +125,8 @@ pub enum Step { Pacstall, Pearl, Pip3, + PipReview, + Pipupgrade, Pipx, Pkg, Pkgin, @@ -154,6 +158,7 @@ pub enum Step { Vim, Winget, Wsl, + WslUpdate, Yadm, Yarn, } @@ -182,6 +187,15 @@ pub struct Windows { self_rename: Option, open_remotes_in_new_terminal: Option, enable_winget: Option, + wsl_update_pre_release: Option, + wsl_update_use_web_download: Option, +} + +#[derive(Deserialize, Default, Debug)] +#[serde(deny_unknown_fields)] +pub struct Python { + enable_pip_review: Option, + enable_pipupgrade: Option, } #[derive(Deserialize, Default, Debug)] @@ -230,15 +244,15 @@ pub struct Brew { #[derive(Debug, Deserialize, Clone, Copy)] #[serde(rename_all = "snake_case")] pub enum ArchPackageManager { - GarudaUpdate, Autodetect, - Trizen, - Paru, - Yay, - Pacman, - Pikaur, - Pamac, Aura, + GarudaUpdate, + Pacman, + Pamac, + Paru, + Pikaur, + Trizen, + Yay, } #[derive(Deserialize, Default, Debug)] @@ -249,10 +263,12 @@ pub struct Linux { aura_pacman_arguments: Option, arch_package_manager: Option, show_arch_news: Option, + garuda_update_arguments: Option, trizen_arguments: Option, pikaur_arguments: Option, pamac_arguments: Option, dnf_arguments: Option, + nix_arguments: Option, apt_arguments: Option, enable_tlmgr: Option, redhat_distro_sync: Option, @@ -292,10 +308,12 @@ pub struct ConfigFile { tmux_arguments: Option, set_title: Option, display_time: Option, + display_preamble: Option, assume_yes: Option, yay_arguments: Option, aura_aur_arguments: Option, aura_pacman_arguments: Option, + python: Option, no_retry: Option, run_in_tmux: Option, cleanup: Option, @@ -739,6 +757,24 @@ impl Config { .unwrap_or(false) } + // Should wsl --update should use the --pre-release flag + pub fn wsl_update_pre_release(&self) -> bool { + self.config_file + .windows + .as_ref() + .and_then(|w| w.wsl_update_pre_release) + .unwrap_or(false) + } + + // Should wsl --update use the --web-download flag + pub fn wsl_update_use_web_download(&self) -> bool { + self.config_file + .windows + .as_ref() + .and_then(|w| w.wsl_update_use_web_download) + .unwrap_or(false) + } + /// Whether Brew cask should be greedy pub fn brew_cask_greedy(&self) -> bool { self.config_file @@ -780,6 +816,15 @@ impl Config { self.config_file.notify_each_step.unwrap_or(false) } + /// Extra garuda-update arguments + pub fn garuda_update_arguments(&self) -> &str { + self.config_file + .linux + .as_ref() + .and_then(|s| s.garuda_update_arguments.as_deref()) + .unwrap_or("") + } + /// Extra trizen arguments pub fn trizen_arguments(&self) -> &str { self.config_file @@ -867,6 +912,14 @@ impl Config { .and_then(|linux| linux.dnf_arguments.as_deref()) } + /// Extra nix arguments + pub fn nix_arguments(&self) -> Option<&str> { + self.config_file + .linux + .as_ref() + .and_then(|linux| linux.nix_arguments.as_deref()) + } + /// Distrobox use root pub fn distrobox_root(&self) -> bool { self.config_file @@ -931,7 +984,7 @@ impl Config { .linux .as_ref() .and_then(|linux| linux.rpm_ostree) - .unwrap_or(false) + .unwrap_or(true) } /// Should we ignore failures for this step @@ -1035,10 +1088,31 @@ impl Config { .unwrap_or(false); } + pub fn enable_pipupgrade(&self) -> bool { + return self + .config_file + .python + .as_ref() + .and_then(|python| python.enable_pipupgrade) + .unwrap_or(false); + } + pub fn enable_pip_review(&self) -> bool { + return self + .config_file + .python + .as_ref() + .and_then(|python| python.enable_pip_review) + .unwrap_or(false); + } + pub fn display_time(&self) -> bool { self.config_file.display_time.unwrap_or(true) } + pub fn display_preamble(&self) -> bool { + self.config_file.display_preamble.unwrap_or(true) + } + pub fn should_run_custom_command(&self, name: &str) -> bool { if self.opt.custom_commands.is_empty() { return true; diff --git a/src/main.rs b/src/main.rs index c071b8a1..4c5998d0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use std::env; use std::io; use std::process::exit; +use std::time::Duration; use clap::CommandFactory; use clap::{crate_version, Parser}; @@ -85,6 +86,13 @@ fn run() -> Result<()> { debug!("Binary path: {:?}", std::env::current_exe()); debug!("Self Update: {:?}", cfg!(feature = "self-update")); + if config.display_preamble() || !config.skip_notify() { + print_warning("Due to a design issue with notify-send it could be that topgrade hangs when it's finished. +If this is the case on your system add the --skip-notify flag to the topgrade command or set skip_notify = true in the config file. +If you don't want this message to appear any longer set display_preamble = false in the config file. +For more information about this issue see https://askubuntu.com/questions/110969/notify-send-ignores-timeout and https://github.com/topgrade-rs/topgrade/issues/288."); + } + if config.run_in_tmux() && env::var("TOPGRADE_INSIDE_TMUX").is_err() { #[cfg(unix)] { @@ -145,9 +153,12 @@ fn run() -> Result<()> { #[cfg(windows)] runner.execute(Step::Wsl, "WSL", || windows::run_wsl_topgrade(&ctx))?; + #[cfg(windows)] + runner.execute(Step::WslUpdate, "WSL", || windows::update_wsl(&ctx))?; + if let Some(topgrades) = config.remote_topgrades() { for remote_topgrade in topgrades.iter().filter(|t| config.should_execute_remote(t)) { - runner.execute(Step::Remotes, format!("Remote ({})", remote_topgrade), || { + runner.execute(Step::Remotes, format!("Remote ({remote_topgrade})"), || { remote::ssh::ssh_step(&ctx, remote_topgrade) })?; } @@ -163,7 +174,7 @@ fn run() -> Result<()> { runner.execute(Step::System, "System update", || distribution.upgrade(&ctx))?; } Err(e) => { - println!("Error detecting current distribution: {}", e); + println!("Error detecting current distribution: {e}"); } } runner.execute(Step::ConfigUpdate, "config-update", || linux::run_config_update(&ctx))?; @@ -352,6 +363,8 @@ fn run() -> Result<()> { runner.execute(Step::Pipx, "pipx", || generic::run_pipx_update(run_type))?; runner.execute(Step::Conda, "conda", || generic::run_conda_update(&ctx))?; runner.execute(Step::Pip3, "pip3", || generic::run_pip3_update(run_type))?; + runner.execute(Step::PipReview, "pip-review", || generic::run_pip_review_update(&ctx))?; + runner.execute(Step::Pipupgrade, "pipupgrade", || generic::run_pipupgrade_update(&ctx))?; runner.execute(Step::Ghcup, "ghcup", || generic::run_ghcup_update(run_type))?; runner.execute(Step::Stack, "stack", || generic::run_stack_update(run_type))?; runner.execute(Step::Tlmgr, "tlmgr", || generic::run_tlmgr_update(&ctx))?; @@ -377,9 +390,7 @@ fn run() -> Result<()> { runner.execute(Step::Krew, "krew", || generic::run_krew_upgrade(run_type))?; runner.execute(Step::Helm, "helm", || generic::run_helm_repo_update(run_type))?; runner.execute(Step::Gem, "gem", || generic::run_gem(&base_dirs, run_type))?; - runner.execute(Step::RubyGems, "rubygems", || { - generic::run_rubygems(&base_dirs, run_type) - })?; + runner.execute(Step::RubyGems, "rubygems", || generic::run_rubygems(&ctx))?; runner.execute(Step::Julia, "julia", || generic::update_julia_packages(&ctx))?; runner.execute(Step::Haxelib, "haxelib", || generic::run_haxelib_update(&ctx))?; runner.execute(Step::Sheldon, "sheldon", || generic::run_sheldon(&ctx))?; @@ -397,6 +408,7 @@ fn run() -> Result<()> { #[cfg(target_os = "linux")] { + runner.execute(Step::AM, "am", || linux::update_am(&ctx))?; runner.execute(Step::DebGet, "deb-get", || linux::run_deb_get(&ctx))?; runner.execute(Step::Toolbx, "toolbx", || toolbx::run_toolbx(&ctx))?; runner.execute(Step::Flatpak, "Flatpak", || linux::flatpak_update(&ctx))?; @@ -405,6 +417,7 @@ fn run() -> Result<()> { runner.execute(Step::Pacdef, "pacdef", || linux::run_pacdef(&ctx))?; runner.execute(Step::Protonup, "protonup", || linux::run_protonup_update(&ctx))?; runner.execute(Step::Distrobox, "distrobox", || linux::run_distrobox_update(&ctx))?; + runner.execute(Step::DkpPacman, "dkp-pacman", || linux::run_dkp_pacman_update(&ctx))?; } if let Some(commands) = config.commands() { @@ -516,8 +529,8 @@ fn run() -> Result<()> { "Topgrade finished {}", if failed { "with errors" } else { "successfully" } ), - None, - ); + Some(Duration::from_secs(10)), + ) } if failed { @@ -550,7 +563,7 @@ fn main() { // The `Debug` implementation of `eyre::Result` prints a multi-line // error message that includes all the 'causes' added with // `.with_context(...)` calls. - println!("Error: {:?}", error); + println!("Error: {error:?}"); } exit(1); } diff --git a/src/report.rs b/src/report.rs index a8efbea9..77e0d57a 100644 --- a/src/report.rs +++ b/src/report.rs @@ -34,7 +34,7 @@ impl<'a> Report<'a> { if let Some((key, success)) = result { let key = key.into(); - debug_assert!(!self.data.iter().any(|(k, _)| k == &key), "{} already reported", key); + debug_assert!(!self.data.iter().any(|(k, _)| k == &key), "{key} already reported"); self.data.push((key, success)); } } diff --git a/src/steps/generic.rs b/src/steps/generic.rs index 541ea2e9..515ead27 100644 --- a/src/steps/generic.rs +++ b/src/steps/generic.rs @@ -10,15 +10,15 @@ use color_eyre::eyre::Context; use color_eyre::eyre::Result; use directories::BaseDirs; use tempfile::tempfile_in; -use tracing::debug; +use tracing::{debug, error}; use crate::command::{CommandExt, Utf8Output}; use crate::execution_context::ExecutionContext; use crate::executor::{ExecutorOutput, RunType}; use crate::terminal::{print_separator, shell}; -use crate::utils::{self, require_option, PathExt}; +use crate::utils::{self, require, require_option, which, PathExt}; use crate::{ - error::{SkipStep, TopgradeError}, + error::{SkipStep, StepFailed, TopgradeError}, terminal::print_warning, }; @@ -83,17 +83,24 @@ pub fn run_gem(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> { command.status_checked() } -pub fn run_rubygems(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> { - let gem = utils::require("gem")?; - base_dirs.home_dir().join(".gem").require()?; +pub fn run_rubygems(ctx: &ExecutionContext) -> Result<()> { + ctx.base_dirs().home_dir().join(".gem").require()?; print_separator("RubyGems"); - - if !std::path::Path::new("/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb").exists() { - run_type.execute(gem).args(["update", "--system"]).status_checked() + if let Some(sudo) = &ctx.sudo() { + if !std::path::Path::new("/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb").exists() { + ctx.run_type() + .execute(sudo) + .arg("-EH") + .arg(require("gem")?) + .args(["update", "--system"]) + .status_checked()?; + } } else { - Ok(()) + print_warning("No sudo detected. Skipping system upgrade"); } + + Ok(()) } pub fn run_haxelib_update(ctx: &ExecutionContext) -> Result<()> { @@ -332,6 +339,39 @@ pub fn run_pip3_update(run_type: RunType) -> Result<()> { .status_checked() } +pub fn run_pip_review_update(ctx: &ExecutionContext) -> Result<()> { + let pip_review = require("pip-review")?; + + print_separator("pip-review"); + + if !ctx.config().enable_pip_review() { + print_warning( + "Pip-review is disabled by default. Enable it by setting enable_pip_review=true in the configuration.", + ); + return Err(SkipStep(String::from("Pip-review is disabled by default")).into()); + } + ctx.run_type() + .execute(pip_review) + .arg("--auto") + .status_checked_with_codes(&[1])?; + + Ok(()) +} +pub fn run_pipupgrade_update(ctx: &ExecutionContext) -> Result<()> { + let pipupgrade = require("pipupgrade")?; + + print_separator("Pipupgrade"); + if !ctx.config().enable_pip_review() { + print_warning( + "Pipupgrade is disabled by default. Enable it by setting enable_pipupgrade=true in the configuration.", + ); + return Err(SkipStep(String::from("Pipupgrade is disabled by default")).into()); + } + ctx.run_type().execute(pipupgrade).status_checked()?; + + Ok(()) +} + pub fn run_stack_update(run_type: RunType) -> Result<()> { if utils::require("ghcup").is_ok() { // `ghcup` is present and probably(?) being used to install `stack`. @@ -435,7 +475,7 @@ pub fn run_composer_update(ctx: &ExecutionContext) -> Result<()> { let composer_home = Command::new(&composer) .args(["global", "config", "--absolute", "--quiet", "home"]) .output_checked_utf8() - .map_err(|e| (SkipStep(format!("Error getting the composer directory: {}", e)))) + .map_err(|e| (SkipStep(format!("Error getting the composer directory: {e}")))) .map(|s| PathBuf::from(s.stdout.trim()))? .require()?; @@ -488,34 +528,43 @@ pub fn run_composer_update(ctx: &ExecutionContext) -> Result<()> { pub fn run_dotnet_upgrade(ctx: &ExecutionContext) -> Result<()> { let dotnet = utils::require("dotnet")?; - let dotnet_help_output = ctx.run_type().execute(&dotnet).arg("-h").output_checked_utf8().unwrap(); - - if dotnet_help_output.to_string().contains("tool") { - let output = Command::new(dotnet) - .args(["tool", "list", "--global"]) - .output_checked_utf8()?; - - if !output.stdout.starts_with("Package Id") { - return Err(SkipStep(String::from("dotnet did not output packages")).into()); + //Skip when the `dotnet tool list` subcommand fails. (This is expected when a dotnet runtime is installed but no SDK.) + let output = match ctx + .run_type() + .execute(&dotnet) + .args(["tool", "list", "--global"]) + .output_checked_utf8() + { + Ok(output) => output, + Err(_) => { + return Err(SkipStep(String::from( + "Error running `dotnet tool list`. This is expected when a dotnet runtime is installed but no SDK.", + )) + .into()) } + }; - let mut packages = output.stdout.lines().skip(2).filter(|line| !line.is_empty()).peekable(); - - if packages.peek().is_none() { - return Err(SkipStep(String::from("No dotnet global tools installed")).into()); - } - - print_separator(".NET"); - - for package in packages { - let package_name = package.split_whitespace().next().unwrap(); - ctx.run_type() - .execute("dotnet") - .args(["tool", "update", package_name, "--global"]) - .status_checked() - .with_context(|| format!("Failed to update .NET package {package_name}"))?; - } + if !output.stdout.starts_with("Package Id") { + return Err(SkipStep(String::from("dotnet did not output packages")).into()); } + + let mut packages = output.stdout.lines().skip(2).filter(|line| !line.is_empty()).peekable(); + + if packages.peek().is_none() { + return Err(SkipStep(String::from("No dotnet global tools installed")).into()); + } + + print_separator(".NET"); + + for package in packages { + let package_name = package.split_whitespace().next().unwrap(); + ctx.run_type() + .execute(&dotnet) + .args(["tool", "update", package_name, "--global"]) + .status_checked() + .with_context(|| format!("Failed to update .NET package {package_name}"))?; + } + Ok(()) } @@ -591,5 +640,24 @@ pub fn run_helm_repo_update(run_type: RunType) -> Result<()> { let helm = utils::require("helm")?; print_separator("Helm"); - run_type.execute(helm).arg("repo").arg("update").status_checked() + + let no_repo = "no repositories found"; + let mut success = true; + let mut exec = run_type.execute(helm); + if let Err(e) = exec.arg("repo").arg("update").status_checked() { + error!("Updating repositories failed: {}", e); + success = match exec.output_checked_utf8() { + Ok(s) => s.stdout.contains(no_repo) || s.stderr.contains(no_repo), + Err(e) => match e.downcast_ref::() { + Some(TopgradeError::ProcessFailedWithOutput(_, _, stderr)) => stderr.contains(no_repo), + _ => false, + }, + }; + } + + if success { + Ok(()) + } else { + Err(eyre!(StepFailed)) + } } diff --git a/src/steps/git.rs b/src/steps/git.rs index 4bd0cbad..0a053982 100644 --- a/src/steps/git.rs +++ b/src/steps/git.rs @@ -71,7 +71,7 @@ async fn pull_repository(repo: String, git: &Path, ctx: &ExecutionContext<'_>) - if let Err(message) = &result { println!("{} pulling {}", style("Failed").red().bold(), &repo); - print!("{}", message); + print!("{message}"); } else { let after_revision = get_head_revision(git, &repo); @@ -87,7 +87,7 @@ async fn pull_repository(repo: String, git: &Path, ctx: &ExecutionContext<'_>) - "log", "--no-decorate", "--oneline", - &format!("{}..{}", before, after), + &format!("{before}..{after}"), ]) .status_checked()?; println!(); @@ -187,7 +187,7 @@ impl Git { repositories .bad_patterns .iter() - .for_each(|pattern| print_warning(format!("Path {} did not contain any git repositories", pattern))); + .for_each(|pattern| print_warning(format!("Path {pattern} did not contain any git repositories"))); self.multi_pull(repositories, ctx) } diff --git a/src/steps/os/archlinux.rs b/src/steps/os/archlinux.rs index cd8b767a..ea03b98f 100644 --- a/src/steps/os/archlinux.rs +++ b/src/steps/os/archlinux.rs @@ -80,8 +80,18 @@ pub struct GarudaUpdate { impl ArchPackageManager for GarudaUpdate { fn upgrade(&self, ctx: &ExecutionContext) -> Result<()> { let mut command = ctx.run_type().execute(&self.executable); - command.env("PATH", get_execution_path()); + + command + .env("PATH", get_execution_path()) + .env("UPDATE_AUR", "1") + .env("SKIP_MIRRORLIST", "1"); + + if ctx.config().yes(Step::System) { + command.env("PACMAN_NOCONFIRM", "1"); + } + command.args(ctx.config().garuda_update_arguments().split_whitespace()); command.status_checked()?; + Ok(()) } } diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index 20d3653f..6ef24e80 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -29,7 +29,9 @@ pub enum Distribution { Debian, Gentoo, OpenMandriva, + PCLinuxOS, Suse, + SuseMicro, Void, Solus, Exherbo, @@ -55,8 +57,10 @@ impl Distribution { Some("gentoo") => Distribution::Gentoo, Some("exherbo") => Distribution::Exherbo, Some("nixos") => Distribution::NixOS, + Some("opensuse-microos") => Distribution::SuseMicro, Some("neon") => Distribution::KDENeon, Some("openmandriva") => Distribution::OpenMandriva, + Some("pclinuxos") => Distribution::PCLinuxOS, _ => { if let Some(id_like) = id_like { if id_like.contains(&"debian") || id_like.contains(&"ubuntu") { @@ -103,6 +107,7 @@ impl Distribution { Distribution::Debian => upgrade_debian(ctx), Distribution::Gentoo => upgrade_gentoo(ctx), Distribution::Suse => upgrade_suse(ctx), + Distribution::SuseMicro => upgrade_suse_micro(ctx), Distribution::Void => upgrade_void(ctx), Distribution::Solus => upgrade_solus(ctx), Distribution::Exherbo => upgrade_exherbo(ctx), @@ -110,6 +115,7 @@ impl Distribution { Distribution::KDENeon => upgrade_neon(ctx), Distribution::Bedrock => update_bedrock(ctx), Distribution::OpenMandriva => upgrade_openmandriva(ctx), + Distribution::PCLinuxOS => upgrade_pclinuxos(ctx), } } @@ -193,7 +199,6 @@ fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> { } else { print_warning("No sudo detected. Skipping system upgrade"); } - Ok(()) } @@ -224,6 +229,18 @@ fn upgrade_suse(ctx: &ExecutionContext) -> Result<()> { Ok(()) } +fn upgrade_suse_micro(ctx: &ExecutionContext) -> Result<()> { + if let Some(sudo) = ctx.sudo() { + ctx.run_type() + .execute(sudo) + .args(["transactional-update", "dup"]) + .status_checked()?; + } else { + print_warning("No sudo detected. Skipping system upgrade"); + } + + Ok(()) +} fn upgrade_openmandriva(ctx: &ExecutionContext) -> Result<()> { if let Some(sudo) = &ctx.sudo() { @@ -246,6 +263,33 @@ fn upgrade_openmandriva(ctx: &ExecutionContext) -> Result<()> { Ok(()) } +fn upgrade_pclinuxos(ctx: &ExecutionContext) -> Result<()> { + if let Some(sudo) = &ctx.sudo() { + let mut command_update = ctx.run_type().execute(sudo); + + command_update.arg(&which("apt-get").unwrap()).arg("update"); + + if let Some(args) = ctx.config().dnf_arguments() { + command_update.args(args.split_whitespace()); + } + + if ctx.config().yes(Step::System) { + command_update.arg("-y"); + } + + command_update.status_checked()?; + + ctx.run_type() + .execute(sudo) + .arg(&which("apt-get").unwrap()) + .arg("dist-upgrade") + .status_checked()?; + } else { + print_warning("No sudo detected. Skipping system upgrade"); + } + + Ok(()) +} fn upgrade_void(ctx: &ExecutionContext) -> Result<()> { if let Some(sudo) = ctx.sudo() { @@ -317,7 +361,13 @@ fn upgrade_gentoo(ctx: &ExecutionContext) -> Result<()> { fn upgrade_debian(ctx: &ExecutionContext) -> Result<()> { if let Some(sudo) = &ctx.sudo() { let apt = which("apt-fast") - .or_else(|| which("nala")) + .or_else(|| { + if Path::new("/usr/bin/nala").exists() { + Some(Path::new("/usr/bin/nala").to_path_buf()) + } else { + None + } + }) .unwrap_or_else(|| PathBuf::from("apt-get")); let is_nala = apt.ends_with("nala"); @@ -385,6 +435,16 @@ fn upgrade_solus(ctx: &ExecutionContext) -> Result<()> { Ok(()) } +pub fn update_am(ctx: &ExecutionContext) -> Result<()> { + if let Some(sudo) = ctx.sudo() { + ctx.run_type().execute(sudo).args(["am", "-u"]).status_checked()?; + } else { + print_warning("No sudo detected. Skipping AM Step"); + } + + Ok(()) +} + pub fn run_pacdef(ctx: &ExecutionContext) -> Result<()> { let pacdef = require("pacdef")?; @@ -401,8 +461,16 @@ pub fn run_pacstall(ctx: &ExecutionContext) -> Result<()> { print_separator("Pacstall"); - ctx.run_type().execute(&pacstall).arg("-U").status_checked()?; - ctx.run_type().execute(pacstall).arg("-Up").status_checked() + let mut update_cmd = ctx.run_type().execute(&pacstall); + let mut upgrade_cmd = ctx.run_type().execute(pacstall); + + if ctx.config().yes(Step::Pacstall) { + update_cmd.arg("-P"); + upgrade_cmd.arg("-P"); + } + + update_cmd.arg("-U").status_checked()?; + upgrade_cmd.arg("-Up").status_checked() } fn upgrade_clearlinux(ctx: &ExecutionContext) -> Result<()> { @@ -452,10 +520,13 @@ fn upgrade_exherbo(ctx: &ExecutionContext) -> Result<()> { fn upgrade_nixos(ctx: &ExecutionContext) -> Result<()> { if let Some(sudo) = ctx.sudo() { - ctx.run_type() - .execute(sudo) - .args(["/run/current-system/sw/bin/nixos-rebuild", "switch", "--upgrade"]) - .status_checked()?; + let mut command = ctx.run_type().execute(sudo); + command.args(["/run/current-system/sw/bin/nixos-rebuild", "switch", "--upgrade"]); + + if let Some(args) = ctx.config().nix_arguments() { + command.args(args.split_whitespace()); + } + command.status_checked()?; if ctx.config().cleanup() { ctx.run_type() @@ -660,6 +731,29 @@ pub fn run_distrobox_update(ctx: &ExecutionContext) -> Result<()> { .status_checked() } +pub fn run_dkp_pacman_update(ctx: &ExecutionContext) -> Result<()> { + let sudo = require_option(ctx.sudo().as_ref(), String::from("sudo is not installed"))?; + let dkp_pacman = require("dkp-pacman")?; + + print_separator("Devkitpro pacman"); + + ctx.run_type() + .execute(sudo) + .arg(&dkp_pacman) + .arg("-Syu") + .status_checked()?; + + if ctx.config().cleanup() { + ctx.run_type() + .execute(sudo) + .arg(&dkp_pacman) + .arg("-Scc") + .status_checked()?; + } + + Ok(()) +} + pub fn run_config_update(ctx: &ExecutionContext) -> Result<()> { let sudo = require_option(ctx.sudo().as_ref(), String::from("sudo is not installed"))?; if ctx.config().yes(Step::ConfigUpdate) { diff --git a/src/steps/os/os_release/pclinuxos b/src/steps/os/os_release/pclinuxos new file mode 100644 index 00000000..2b1680c6 --- /dev/null +++ b/src/steps/os/os_release/pclinuxos @@ -0,0 +1,9 @@ +NAME="PCLinuxOS" +VERSION="2022" +ID=pclinuxos +VERSION_ID=2022 +ID_LIKE="mandriva" +PRETTY_NAME="PCLinuxOS 2022" +ANSI_COLOR="1;37" +HOME_URL="http://www.pclinuxos.com/" +SUPPORT_URL="http://www.pclinuxos.com/" diff --git a/src/steps/os/windows.rs b/src/steps/os/windows.rs index aff201dc..911a0d2f 100644 --- a/src/steps/os/windows.rs +++ b/src/steps/os/windows.rs @@ -68,6 +68,25 @@ pub fn run_scoop(cleanup: bool, run_type: RunType) -> Result<()> { Ok(()) } +pub fn update_wsl(ctx: &ExecutionContext) -> Result<()> { + let wsl = require("wsl")?; + + print_separator("Update WSL"); + + let mut wsl_command = ctx.run_type().execute(wsl); + wsl_command.args(["--update"]); + + if ctx.config().wsl_update_pre_release() { + wsl_command.args(["--pre-release"]); + } + + if ctx.config().wsl_update_use_web_download() { + wsl_command.args(["--web-download"]); + } + wsl_command.status_checked()?; + Ok(()) +} + fn get_wsl_distributions(wsl: &Path) -> Result> { let output = Command::new(wsl).args(["--list", "-q"]).output_checked_utf8()?.stdout; Ok(output @@ -86,7 +105,7 @@ fn upgrade_wsl_distribution(wsl: &Path, dist: &str, ctx: &ExecutionContext) -> R let mut command = ctx.run_type().execute(wsl); command .args(["-d", dist, "bash", "-c"]) - .arg(format!("TOPGRADE_PREFIX={} exec {}", dist, topgrade)); + .arg(format!("TOPGRADE_PREFIX={dist} exec {topgrade}")); if ctx.config().yes(Step::Wsl) { command.arg("-y"); diff --git a/src/steps/powershell.rs b/src/steps/powershell.rs index f6fe50e3..6be22493 100644 --- a/src/steps/powershell.rs +++ b/src/steps/powershell.rs @@ -50,7 +50,7 @@ impl Powershell { .args([ "-NoProfile", "-Command", - &format!("Get-Module -ListAvailable {}", command), + &format!("Get-Module -ListAvailable {command}"), ]) .output_checked_utf8() .map(|result| !result.stdout.is_empty()) diff --git a/src/steps/remote/ssh.rs b/src/steps/remote/ssh.rs index c274766d..6a9f244c 100644 --- a/src/steps/remote/ssh.rs +++ b/src/steps/remote/ssh.rs @@ -19,7 +19,7 @@ pub fn ssh_step(ctx: &ExecutionContext, hostname: &str) -> Result<()> { args.extend(ssh_arguments.split_whitespace()); } - let env = format!("TOPGRADE_PREFIX={}", hostname); + let env = format!("TOPGRADE_PREFIX={hostname}"); args.extend(["env", &env, "$SHELL", "-lc", topgrade]); if ctx.config().run_in_tmux() && !ctx.run_type().dry() { @@ -43,11 +43,11 @@ pub fn ssh_step(ctx: &ExecutionContext, hostname: &str) -> Result<()> { args.extend(ssh_arguments.split_whitespace()); } - let env = format!("TOPGRADE_PREFIX={}", hostname); + let env = format!("TOPGRADE_PREFIX={hostname}"); args.extend(["env", &env, "$SHELL", "-lc", topgrade]); - print_separator(format!("Remote ({})", hostname)); - println!("Connecting to {}...", hostname); + print_separator(format!("Remote ({hostname})")); + println!("Connecting to {hostname}..."); ctx.run_type().execute(ssh).args(&args).status_checked() } diff --git a/src/steps/remote/vagrant.rs b/src/steps/remote/vagrant.rs index b7fbfb18..dc022797 100644 --- a/src/steps/remote/vagrant.rs +++ b/src/steps/remote/vagrant.rs @@ -183,7 +183,7 @@ pub fn topgrade_vagrant_box(ctx: &ExecutionContext, vagrant_box: &VagrantBox) -> let mut _poweron = None; if !vagrant_box.initial_status.powered_on() { if !(ctx.config().vagrant_power_on().unwrap_or(true)) { - return Err(SkipStep(format!("Skipping powered off box {}", vagrant_box)).into()); + return Err(SkipStep(format!("Skipping powered off box {vagrant_box}")).into()); } else { print_separator(seperator); _poweron = Some(vagrant.temporary_power_on(vagrant_box, ctx)?); diff --git a/src/steps/toolbx.rs b/src/steps/toolbx.rs index 1c8a7583..8525efb8 100644 --- a/src/steps/toolbx.rs +++ b/src/steps/toolbx.rs @@ -42,7 +42,7 @@ pub fn run_toolbx(ctx: &ExecutionContext) -> Result<()> { let topgrade_path = topgrade_path.to_str().unwrap(); for tb in toolboxes.iter() { - let topgrade_prefix = format!("TOPGRADE_PREFIX='Toolbx {}'", tb); + let topgrade_prefix = format!("TOPGRADE_PREFIX='Toolbx {tb}'"); let mut args = vec![ "run", "-c", diff --git a/src/terminal.rs b/src/terminal.rs index b0b763b3..6bd84678 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -60,7 +60,7 @@ impl Terminal { width: term.size_checked().map(|(_, w)| w), term, prefix: env::var("TOPGRADE_PREFIX") - .map(|prefix| format!("({}) ", prefix)) + .map(|prefix| format!("({prefix}) ")) .unwrap_or_else(|_| String::new()), set_title: true, display_time: true, @@ -143,7 +143,7 @@ impl Terminal { .write_fmt(format_args!( "{}\n", style(format_args!( - "\n―― {} {:―^border$}", + "\n── {} {:─^border$}", message, "", border = max( @@ -159,7 +159,7 @@ impl Terminal { .ok(); } None => { - self.term.write_fmt(format_args!("―― {} ――\n", message)).ok(); + self.term.write_fmt(format_args!("―― {message} ――\n")).ok(); } } } @@ -171,7 +171,7 @@ impl Terminal { self.term .write_fmt(format_args!( "{} {}", - style(format!("{} failed:", key)).red().bold(), + style(format!("{key} failed:")).red().bold(), message )) .ok(); @@ -215,7 +215,7 @@ impl Terminal { self.term .write_fmt(format_args!( "{}", - style(format!("{} (y)es/(N)o", question,)).yellow().bold() + style(format!("{question} (y)es/(N)o",)).yellow().bold() )) .ok(); @@ -237,13 +237,15 @@ impl Terminal { self.term.set_title("Topgrade - Awaiting user"); } - self.notify_desktop(format!("{} failed", step_name), None); + if self.desktop_notification { + self.notify_desktop(format!("{step_name} failed"), None); + } let prompt_inner = style(format!("{}Retry? (y)es/(N)o/(s)hell/(q)uit", self.prefix)) .yellow() .bold(); - self.term.write_fmt(format_args!("\n{}", prompt_inner)).ok(); + self.term.write_fmt(format_args!("\n{prompt_inner}")).ok(); let answer = loop { match self.term.read_key() { @@ -251,7 +253,7 @@ impl Terminal { Ok(Key::Char('s')) | Ok(Key::Char('S')) => { println!("\n\nDropping you to shell. Fix what you need and then exit the shell.\n"); if let Err(err) = run_shell().context("Failed to run shell") { - self.term.write_fmt(format_args!("{err:?}\n{}", prompt_inner)).ok(); + self.term.write_fmt(format_args!("{err:?}\n{prompt_inner}")).ok(); } else { break Ok(true); } diff --git a/src/utils.rs b/src/utils.rs index 486bab1f..23ec64ca 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -149,6 +149,6 @@ pub fn hostname() -> Result { Command::new("hostname") .output_checked_utf8() - .map_err(|err| SkipStep(format!("Failed to get hostname: {}", err)).into()) + .map_err(|err| SkipStep(format!("Failed to get hostname: {err}")).into()) .map(|output| output.stdout.trim().to_owned()) }