diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c307ec5..31000a2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,20 +8,15 @@ on: env: CARGO_TERM_COLOR: always - XDBM_ENABLE_OVERWRITE_GITCONFIG: true jobs: - build-and-lint: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Setup - run: rustup component add clippy + - uses: actions/checkout@v3 - name: Build run: cargo build --verbose - name: Run tests run: cargo test --verbose - - name: Lint - run: cargo clippy --all-targets --all-features diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d354d..982082d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,29 +1,5 @@ # Changelog -## [Unreleased] - -### Added -- Option to use `git` cli in `sync` subcommand. This is now the default (#27) - -## [0.4.0] - 2025-03-01 - -### Added -- `sync` subcommand, which performs git pull (fast-forward) and push (#21) -- Feature `vendored-openssl` to statically link openssl and libgit2 (#22) - -### Fixed -- Git local config is now looked up. (#20) -- Git global config will not be polluted in test by default. (#20) - -## [0.3.0] - 2024-12-02 - -### Added -- Add `status` subcommand to see storage and backup on given path or current working directory ([#17](https://github.com/qwjyh/xdbm/pull/17)). - -### Changed -- Colored output for `storage list` and `backup list` ([#15](https://github.com/qwjyh/xdbm/pull/15)) -- **BREAKING** Relative path is changed from `PathBuf` to `Vector` for portability. This means that existing config files need to be changed. - ## [0.2.1] - 2024-06-19 ### Changed @@ -54,9 +30,6 @@ - `backup done` subcommand - `completion` subcommand -[Unreleased]: https://github.com/qwjyh/xdbm/compare/v0.4.0...HEAD -[0.4.0]: https://github.com/qwjyh/xdbm/compare/v0.3.0...v0.4.0 -[0.3.0]: https://github.com/qwjyh/xdbm/compare/v0.2.1...v0.3.0 [0.2.1]: https://github.com/qwjyh/xdbm/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/qwjyh/xdbm/releases/tag/v0.2.0 [0.1.0]: https://github.com/qwjyh/xdbm/releases/tag/v0.1.0 diff --git a/Cargo.lock b/Cargo.lock index 6dd362c..efc48ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] name = "ahash" @@ -8,7 +8,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.15", + "getrandom", "once_cell", "version_check", ] @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", @@ -54,61 +54,59 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", - "once_cell", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.96" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "assert_cmd" -version = "2.0.16" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" +checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8" dependencies = [ "anstyle", "bstr", "doc-comment", - "libc", "predicates", "predicates-core", "predicates-tree", @@ -117,9 +115,9 @@ dependencies = [ [[package]] name = "assert_fs" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efdb1fdb47602827a342857666feb372712cbc64b414172bd6b167a02927674" +checksum = "2cd762e110c8ed629b11b6cde59458cc1c71de78ebbcc30099fc8e0403a2a2ec" dependencies = [ "anstyle", "doc-comment", @@ -132,9 +130,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" @@ -144,9 +142,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -162,9 +160,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.5" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" dependencies = [ "borsh-derive", "cfg_aliases", @@ -172,22 +170,23 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.5" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b668d39970baad5356d7c83a86fee3a539e6f93bf6764c97368243e17a0487" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.66", + "syn_derive", ] [[package]] name = "bstr" -version = "1.11.3" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "regex-automata", @@ -196,15 +195,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-unit" -version = "5.1.6" +version = "5.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cd29c3c585209b0cbc7309bfe3ed7efd8c84c21b7af29c8bfae908f8777174" +checksum = "33ac19bdf0b2665407c39d82dbc937e951e7e2001609f0fb32edd0af45a2d63e" dependencies = [ "rust_decimal", "serde", @@ -241,19 +240,19 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.2.15" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", - "shlex", + "once_cell", ] [[package]] @@ -270,9 +269,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -280,14 +279,14 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-link", + "windows-targets 0.52.5", ] [[package]] name = "clap" -version = "4.5.31" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -295,9 +294,9 @@ dependencies = [ [[package]] name = "clap-verbosity-flag" -version = "3.0.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2678fade3b77aa3a8ff3aae87e9c008d3fb00473a41c71fbf74e91c8c7b37e84" +checksum = "bb9b20c0dd58e4c2e991c8d203bbeb76c11304d1011659686b5b644bc29aa478" dependencies = [ "clap", "log", @@ -305,9 +304,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.31" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -317,61 +316,48 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.46" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5c5508ea23c5366f77e53f5a0070e5a84e51687ec3ef9e0464c86dc8d13ce98" +checksum = "d2020fa13af48afc65a9a87335bda648309ab3d154cd03c7ff95b378c7ed39c4" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.66", ] [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - -[[package]] -name = "console" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" -dependencies = [ - "encode_unicode", - "libc", - "once_cell", - "unicode-width 0.2.0", - "windows-sys 0.59.0", -] +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "core-foundation-sys" -version = "0.8.7" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "crossbeam-deque" -version = "0.8.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -388,9 +374,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -444,17 +430,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "doc-comment" version = "0.3.3" @@ -463,33 +438,27 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dunce" -version = "1.0.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" -version = "1.14.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" - -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "env_filter" -version = "0.1.3" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" dependencies = [ "log", "regex", @@ -497,9 +466,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.6" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -510,31 +479,31 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "fastrand" -version = "2.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "float-cmp" -version = "0.10.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" dependencies = [ "num-traits", ] @@ -580,19 +549,7 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "wasi", ] [[package]] @@ -601,7 +558,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.5.0", "libc", "libgit2-sys", "log", @@ -612,9 +569,9 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.15" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", @@ -629,7 +586,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.5.0", "ignore", "walkdir", ] @@ -645,9 +602,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -663,16 +620,16 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -684,150 +641,21 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "idna" -version = "1.0.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", + "unicode-bidi", + "unicode-normalization", ] [[package]] name = "ignore" -version = "0.4.23" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ "crossbeam-deque", "globset", @@ -841,12 +669,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.14.5", ] [[package]] @@ -855,7 +683,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.5.0", "crossterm", "dyn-clone", "fuzzy-matcher", @@ -863,45 +691,44 @@ dependencies = [ "newline-converter", "once_cell", "unicode-segmentation", - "unicode-width 0.1.14", + "unicode-width", ] [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ - "once_cell", "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.170" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libgit2-sys" @@ -923,15 +750,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.5.0", "libc", ] [[package]] name = "libssh2-sys" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" dependencies = [ "cc", "libc", @@ -943,9 +770,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.21" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "libc", @@ -955,15 +782,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "litemap" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -977,9 +798,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" @@ -995,7 +816,7 @@ checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -1034,34 +855,24 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl-probe" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-src" -version = "300.4.2+3.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" -dependencies = [ - "cc", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.106" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", - "openssl-src", "pkg-config", "vcpkg", ] @@ -1092,14 +903,14 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] name = "pathdiff" -version = "0.2.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "percent-encoding" @@ -1109,24 +920,21 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "3.1.3" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" dependencies = [ "anstyle", "difflib", @@ -1138,15 +946,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.9" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" [[package]] name = "predicates-tree" -version = "1.0.12" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" dependencies = [ "predicates-core", "termtree", @@ -1154,18 +962,41 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ "toml_edit", ] [[package]] -name = "proc-macro2" -version = "1.0.93" +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -1192,9 +1023,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.38" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1232,7 +1063,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom", ] [[package]] @@ -1257,29 +1088,29 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.5.0", ] [[package]] name = "redox_users" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.15", + "getrandom", "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -1289,9 +1120,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -1300,9 +1131,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rend" @@ -1315,9 +1146,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.45" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" dependencies = [ "bitvec", "bytecheck", @@ -1333,9 +1164,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.45" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ "proc-macro2", "quote", @@ -1344,9 +1175,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.36.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" dependencies = [ "arrayvec", "borsh", @@ -1360,28 +1191,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] -[[package]] -name = "rustversion" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" - [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -1406,32 +1231,31 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "serde" -version = "1.0.218" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", - "memchr", "ryu", "serde", ] @@ -1449,12 +1273,6 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "signal-hook" version = "0.3.17" @@ -1467,9 +1285,9 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" dependencies = [ "libc", "mio", @@ -1487,21 +1305,15 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "smallvec" -version = "1.14.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "strsim" @@ -1522,9 +1334,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -1532,26 +1344,28 @@ dependencies = [ ] [[package]] -name = "synstructure" -version = "0.13.1" +name = "syn_derive" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" dependencies = [ + "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.66", ] [[package]] name = "sysinfo" -version = "0.32.1" +version = "0.30.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c33cd241af0f2e9e3b5c32163b873b29956890b5342e6745b917ce9d490f4af" +checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" dependencies = [ + "cfg-if", "core-foundation-sys", "libc", - "memchr", "ntapi", + "once_cell", "rayon", "serde", "windows", @@ -1565,42 +1379,40 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.17.1" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "getrandom 0.3.1", - "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] name = "termtree" -version = "0.5.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.69" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.66", ] [[package]] @@ -1613,21 +1425,11 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -1640,15 +1442,15 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" [[package]] name = "toml_edit" -version = "0.22.24" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", @@ -1656,28 +1458,37 @@ dependencies = [ ] [[package]] -name = "unicode-ident" -version = "1.0.17" +name = "unicode-bidi" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unsafe-libyaml" @@ -1687,33 +1498,21 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.5.4" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -1722,9 +1521,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.15.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8dcafa1ca14750d8d7a05aa05988c17aab20886e1f3ae33a40223c58d92ef7" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "vcpkg" @@ -1734,15 +1533,15 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wait-timeout" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" dependencies = [ "libc", ] @@ -1763,46 +1562,36 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" -dependencies = [ - "wit-bindgen-rt", -] - [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", - "once_cell", - "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", + "once_cell", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1810,25 +1599,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "winapi" @@ -1848,11 +1634,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -1863,12 +1649,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.57.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.57.0", - "windows-targets 0.52.6", + "windows-core", + "windows-targets 0.52.5", ] [[package]] @@ -1877,56 +1663,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-implement" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "windows-interface" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "windows-link" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" - -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -1940,11 +1677,11 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -1964,18 +1701,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -1986,9 +1723,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1998,9 +1735,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2010,15 +1747,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] name = "windows_i686_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2028,9 +1765,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2040,9 +1777,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2052,9 +1789,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2064,40 +1801,19 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.7.3" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] -[[package]] -name = "wit-bindgen-rt" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags 2.8.0", -] - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "wyz" version = "0.5.1" @@ -2109,7 +1825,7 @@ dependencies = [ [[package]] name = "xdbm" -version = "0.4.0" +version = "0.2.1" dependencies = [ "anyhow", "assert_cmd", @@ -2119,7 +1835,6 @@ dependencies = [ "clap", "clap-verbosity-flag", "clap_complete", - "console", "dirs", "dunce", "env_logger", @@ -2131,93 +1846,5 @@ dependencies = [ "serde", "serde_yaml", "sysinfo", - "unicode-width 0.2.0", -] - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", - "synstructure", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "zerofrom" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", - "synstructure", -] - -[[package]] -name = "zerovec" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", + "unicode-width", ] diff --git a/Cargo.toml b/Cargo.toml index 1daa11c..8c7aa5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "xdbm" -version = "0.4.0" +version = "0.2.1" authors = ["qwjyh "] -edition = "2024" +edition = "2021" description = "Cross device backup manager, which manages backups on several storages mounted on multiple devices." readme = "README.md" homepage = "https://github.com/qwjyh/xdbm" @@ -13,29 +13,25 @@ keywords = ["cli", "backup"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.5", features = ["cargo", "derive"] } -sysinfo = { version = "0.32", features = ["serde"] } +clap = { version = "4.4.0", features = ["cargo", "derive"] } +sysinfo = { version = "0.30", features = ["serde"] } log = "0.4" -clap-verbosity-flag = "3.0" +clap-verbosity-flag = "2.2" clap_complete = "4.5" chrono = { version = "0.4", features = ["serde"] } -env_logger = "0.11.5" +env_logger = "0.11.3" inquire = "0.7.5" git2 = "0.19" dirs = "5.0" -dunce = "1.0.5" +dunce = "1.0.4" serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.9" -byte-unit = "5.1" +byte-unit = "5.1.4" anyhow = "1.0" -pathdiff = "0.2.3" -unicode-width = "0.2.0" -console = "0.15" +pathdiff = "0.2.1" +unicode-width = "0.1.13" [dev-dependencies] -assert_cmd = "2.0.16" -assert_fs = "1.1.2" -predicates = "3.1.2" - -[features] -vendored-openssl = ["git2/vendored-openssl"] +assert_cmd = "2.0.14" +assert_fs = "1.1.1" +predicates = "3.1.0" diff --git a/README.md b/README.md index 8dd916f..15010ee 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ _Cross device backup manager_, which manages backups on several storages mounted on multiple devices with a single repository. -## Install -- `git` is required for sync - ## Usage 1. `xdbm init` to setup new device(i.e. PC). 2. `xdbm storage add` to add storages, or `xdbm storage bind` to make existing storages available on new device. @@ -27,7 +24,7 @@ which manages backups on several storages mounted on multiple devices with a sin - [ ] write test for storage subcommand - [x] storage add online - [x] storage add directory - - [x] storage list + - [ ] storage list - [x] update storage bind command - [ ] add storage remove command - [ ] add sync subcommand @@ -41,7 +38,7 @@ which manages backups on several storages mounted on multiple devices with a sin - [x] backup list - [x] status printing - [x] backup done -- [x] fancy display +- [ ] fancy display - [ ] json output - [ ] no commit option diff --git a/src/backups.rs b/src/backups.rs index 8f70509..fbb4c1f 100644 --- a/src/backups.rs +++ b/src/backups.rs @@ -27,38 +27,32 @@ pub fn backups_file(device: &Device) -> PathBuf { } /// Targets for backup source or destination. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct BackupTarget { /// `name()` of [`crate::storages::Storage`]. /// Use `String` for serialization/deserialization. pub storage: String, /// Relative path to the `storage`. - pub path: Vec, + pub path: PathBuf, } impl BackupTarget { - pub fn new(storage_name: String, relative_path: PathBuf) -> Result { - let relative_path = relative_path - .components() - .map(|c| c.as_os_str().to_str().map(|s| s.to_owned())) - .collect::>() - .context("Path contains non-utf8 character")?; - Ok(BackupTarget { + pub fn new(storage_name: String, relative_path: PathBuf) -> Self { + BackupTarget { storage: storage_name, path: relative_path, - }) + } } - /// Get full path of the [`BackupTarget`]. - pub fn path(&self, storages: &Storages, device: &Device) -> Option { + pub fn path(&self, storages: &Storages, device: &Device) -> Result { let parent = storages.get(&self.storage).unwrap(); let parent_path = parent.mount_path(device)?; - Some(parent_path.join(self.path.clone().iter().collect::())) + Ok(parent_path.join(self.path.clone())) } } /// Type of backup commands. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub enum BackupCommand { ExternallyInvoked(ExternallyInvoked), } @@ -85,7 +79,7 @@ impl BackupCommandExt for BackupCommand { /// Backup commands which is not invoked from xdbm itself. /// Call xdbm externally to record backup datetime and status. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct ExternallyInvoked { name: String, pub note: String, @@ -108,7 +102,7 @@ impl BackupCommandExt for ExternallyInvoked { } /// Backup execution log. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct BackupLog { pub datetime: DateTime, status: BackupResult, @@ -128,7 +122,7 @@ impl BackupLog { } /// Result of backup. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub enum BackupResult { Success, Failure, @@ -145,7 +139,7 @@ impl BackupResult { } /// Backup source, destination, command and logs. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct Backup { /// must be unique name: String, @@ -180,7 +174,7 @@ impl Backup { &self.name } - pub fn device<'a>(&'a self, devices: &'a [Device]) -> Option<&'a Device> { + pub fn device<'a>(&'a self, devices: &'a [Device]) -> Option<&Device> { devices.iter().find(|dev| dev.name() == self.device) } @@ -206,7 +200,7 @@ impl Backup { } } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct Backups { pub list: BTreeMap, } diff --git a/src/cmd_args.rs b/src/cmd_args.rs index 82debe6..28a41ec 100644 --- a/src/cmd_args.rs +++ b/src/cmd_args.rs @@ -1,7 +1,7 @@ //! CLI arguments -use crate::PathBuf; use crate::path; +use crate::PathBuf; use clap::Args; use clap::{Parser, Subcommand}; use clap_verbosity_flag::Verbosity; @@ -44,18 +44,6 @@ pub(crate) enum Commands { #[command(subcommand)] Backup(BackupSubCommands), - /// Print status for the given path. - Status { - /// Target path. Default is the current directory. - path: Option, - /// Show storage which the path belongs to. - #[arg(short, long)] - storage: bool, - /// Show backup config covering the path. - #[arg(short, long)] - backup: bool, - }, - /// Print config dir. Path {}, @@ -63,22 +51,15 @@ pub(crate) enum Commands { Sync { /// Remote name to sync. remote_name: Option, - /// Use custom git implementation. - #[arg(short, long)] - use_libgit2: bool, - /// Whether to use ssh-agent - #[arg(long)] - use_sshagent: bool, - /// Manually specify ssh key - #[arg(long)] - ssh_key: Option, }, /// Check config files validity. Check {}, /// Generate completion script. - Completion { shell: clap_complete::Shell }, + Completion { + shell: clap_complete::Shell, + } } #[derive(Args, Debug)] diff --git a/src/cmd_backup.rs b/src/cmd_backup.rs index cab7a9e..618ad6c 100644 --- a/src/cmd_backup.rs +++ b/src/cmd_backup.rs @@ -6,7 +6,6 @@ use std::{ use anyhow::{anyhow, Context, Ok, Result}; use chrono::Local; -use console::Style; use dunce::canonicalize; use git2::Repository; use unicode_width::UnicodeWidthStr; @@ -89,8 +88,8 @@ fn new_backup( Ok(Backup::new( name, device.name(), - src_target?, - dest_target?, + src_target, + dest_target, command, )) } @@ -177,16 +176,10 @@ fn write_backups_list( ))?; name_width = name_width.max(backup.name().width()); dev_width = dev_width.max(dev.width()); - let src = backup - .source() - .path(storages, device) - .context("Couldn't get path for source")?; + let src = backup.source().path(storages, device)?; src_width = src_width.max(format!("{}", src.display()).width()); src_storage_width = src_storage_width.max(backup.source().storage.width()); - let dest = backup - .destination() - .path(storages, device) - .context("Couldn't get path for destination")?; + let dest = backup.destination().path(storages, device)?; dest_width = dest_width.max(format!("{}", dest.display()).width()); dest_storage_width = dest_storage_width.max(backup.destination().storage.width()); let cmd_name = backup.command().name(); @@ -195,77 +188,39 @@ fn write_backups_list( // main printing for ((dev, _name), backup) in &backups { let device = backup.device(devices).context(format!( - "Couldn't find the device specified in the backup config: {}", + "Couldn't find device specified in backup config {}", backup.name() ))?; - let src = backup - .source() - .path(storages, device) - .context("Couldn't get path for source")?; - let dest = backup - .destination() - .path(storages, device) - .context("Couldn't get path for destination")?; + let src = backup.source().path(storages, device)?; + let dest = backup.destination().path(storages, device)?; let cmd_name = backup.command().name(); - let (last_backup_elapsed, style_on_time_elapsed) = match backup.last_backup() { + let last_backup_elapsed = match backup.last_backup() { Some(log) => { let time = Local::now() - log.datetime; - let s = util::format_summarized_duration(time); - let style = util::duration_style(time); - (style.apply_to(s), style) - } - None => { - let style = Style::new().red(); - (style.apply_to("---".to_string()), style) + util::format_summarized_duration(time) } + None => "---".to_string(), }; - if !longprint { - writeln!( - writer, - "{name: date.datetime.format("%Y-%m-%d %T").to_string(), - None => "never".to_string(), - }; + writeln!( + writer, + "{name:, - show_storage: bool, - show_backup: bool, - config_dir: &Path, -) -> Result<()> { - let path = path.unwrap_or(env::current_dir().context("Failed to get current directory.")?); - let current_device = devices::get_device(config_dir)?; - - if show_storage { - let storages = storages::Storages::read(config_dir)?; - let storage = util::min_parent_storage(&path, &storages, ¤t_device); - trace!("storage {:?}", storage); - - // TODO: recursively trace all storages for subdirectory? - match storage { - Some(storage) => { - println!("Storage: {}", storage.0.name()) - } - None => { - println!("Storage: None"); - } - } - } - if show_backup { - let devices = devices::get_devices(config_dir)?; - let storages = storages::Storages::read(config_dir)?; - let backups = devices.iter().map(|device| { - Backups::read(config_dir, device) - .context("Backups were not found") - .unwrap() - }); - - let (target_storage, target_diff_from_storage) = - util::min_parent_storage(&path, &storages, ¤t_device) - .context("Target path is not covered in any storage")?; - - let covering_backup: Vec<_> = devices - .iter() - .zip(backups) - .map(|(device, backups)| { - debug!( - "dev {}, storage {:?}", - device.name(), - backups - .list - .iter() - .map(|(backup_name, backup)| format!( - "{} {}", - backup_name, - backup.source().storage - )) - .collect::>() - ); - ( - device, - parent_backups( - &target_diff_from_storage, - target_storage, - backups, - &storages, - device, - ), - ) - }) - .collect(); - trace!("{:?}", covering_backup.first()); - - let name_len = &covering_backup - .iter() - .map(|(_, backups)| { - backups - .iter() - .map(|(backup, _path)| backup.name().len()) - .max() - .unwrap_or(0) - }) - .max() - .unwrap_or(5); - - for (backup_device, covering_backups) in covering_backup { - if covering_backups.is_empty() { - continue; - } - - println!("Device: {}", backup_device.name()); - for (backup, path_from_backup) in covering_backups { - let (last_backup, style) = match backup.last_backup() { - Some(log) => { - let timediff = Local::now() - log.datetime; - ( - util::format_summarized_duration(timediff), - util::duration_style(timediff), - ) - } - None => ("---".to_string(), Style::new().red()), - }; - println!( - " {:( - target_path_from_storage: &'a Path, - target_storage: &'a Storage, - backups: Backups, - storages: &'a Storages, - device: &'a Device, -) -> Vec<(Backup, PathBuf)> { - trace!("Dev {:?}", device.name()); - let target_path = match target_storage.mount_path(device) { - Some(target_path) => target_path.join(target_path_from_storage), - None => return vec![], - }; - trace!("Path on the device {:?}", target_path); - backups - .list - .into_iter() - .filter_map(|(_k, backup)| { - let backup_path = backup.source().path(storages, device)?; - trace!("{:?}", backup_path.components()); - let diff = pathdiff::diff_paths(&target_path, backup_path.clone())?; - trace!("Backup: {:?}, Diff: {:?}", backup_path, diff); - // note: Should `RootDir` is included in this list? - if diff - .components() - .any(|c| matches!(c, path::Component::ParentDir | path::Component::Prefix(_))) - { - None - } else { - Some((backup, diff)) - } - }) - .collect() -} - -#[cfg(test)] -mod test { - use std::{path::PathBuf, vec}; - - use crate::{ - backups::{self, ExternallyInvoked}, - devices, - storages::{self, online_storage::OnlineStorage, StorageExt}, - util, - }; - - use super::parent_backups; - - #[test] - fn test_parent_backups() { - let device1 = devices::Device::new("device_1".to_string()); - let mut storage1 = storages::Storage::Online(OnlineStorage::new( - "storage_1".to_string(), - "smb".to_string(), - 1_000_000, - "str1".to_string(), - PathBuf::from("/home/foo/"), - &device1, - )); - let storage2 = storages::Storage::Online(OnlineStorage::new( - "storage_2".to_string(), - "smb".to_string(), - 1_000_000_000, - "str2".to_string(), - PathBuf::from("/"), - &device1, - )); - let device2 = devices::Device::new("device_2".to_string()); - storage1 - .bound_on_device("alias".to_string(), PathBuf::from("/mnt/dev"), &device2) - .unwrap(); - let storage3 = storages::Storage::Online(OnlineStorage::new( - "storage_3".to_string(), - "smb".to_string(), - 2_000_000_000, - "str2".to_string(), - PathBuf::from("/"), - &device2, - )); - let storages = { - let mut storages = storages::Storages::new(); - storages.add(storage1).unwrap(); - storages.add(storage2).unwrap(); - storages.add(storage3).unwrap(); - storages - }; - - let backup1 = backups::Backup::new( - "backup_1".to_string(), - device1.name().to_string(), - backups::BackupTarget { - storage: "storage_1".to_string(), - path: vec!["bar".to_string()], - }, - backups::BackupTarget { - storage: "storage_1".to_string(), - path: vec!["hoge".to_string()], - }, - backups::BackupCommand::ExternallyInvoked(ExternallyInvoked::new( - "cmd".to_string(), - "".to_string(), - )), - ); - let backup2 = backups::Backup::new( - "backup_2".to_string(), - device2.name().to_string(), - backups::BackupTarget { - storage: "storage_1".to_string(), - path: vec!["".to_string()], - }, - backups::BackupTarget { - storage: "storage_3".to_string(), - path: vec!["foo".to_string()], - }, - backups::BackupCommand::ExternallyInvoked(ExternallyInvoked::new( - "cmd".to_string(), - "".to_string(), - )), - ); - - let backups = { - let mut backups = backups::Backups::new(); - backups.add(backup1).unwrap(); - backups.add(backup2).unwrap(); - backups - }; - - let target_path1 = PathBuf::from("/home/foo/bar/hoo"); - let (target_storage1, target_path_from_storage1) = - util::min_parent_storage(&target_path1, &storages, &device1) - .expect("Failed to get storage"); - let covering_backups_1 = parent_backups( - &target_path_from_storage1, - target_storage1, - backups.clone(), - &storages, - &device1, - ); - assert_eq!(covering_backups_1.len(), 2); - - let target_path2 = PathBuf::from("/mnt/"); - let (target_storage2, target_path_from_storage2) = - util::min_parent_storage(&target_path2, &storages, &device2) - .expect("Failed to get storage"); - let covering_backups_2 = parent_backups( - &target_path_from_storage2, - target_storage2, - backups.clone(), - &storages, - &device2, - ); - assert_eq!(covering_backups_2.len(), 0); - - let target_path3 = PathBuf::from("/mnt/dev/foo"); - let (target_storage3, target_path_from_storage3) = - util::min_parent_storage(&target_path3, &storages, &device2) - .expect("Failed to get storage"); - let covering_backups_3 = parent_backups( - &target_path_from_storage3, - target_storage3, - backups, - &storages, - &device2, - ); - assert_eq!(covering_backups_3.len(), 1); - let mut covering_backup_names_3 = - covering_backups_3.iter().map(|(backup, _)| backup.name()); - assert_eq!(covering_backup_names_3.next().unwrap(), "backup_2"); - assert!(covering_backup_names_3.next().is_none()); - } -} diff --git a/src/cmd_storage.rs b/src/cmd_storage.rs index 2cb9414..038a5fd 100644 --- a/src/cmd_storage.rs +++ b/src/cmd_storage.rs @@ -7,7 +7,6 @@ use std::{ use anyhow::{anyhow, Context, Result}; use byte_unit::{Byte, UnitType}; -use console::style; use dunce::canonicalize; use git2::Repository; use inquire::{Confirm, CustomType, Text}; @@ -212,11 +211,11 @@ fn write_storages_list( "-" } } else { - "" + " " }; let path = storage.mount_path(device).map_or_else( - || { - info!("Mount path not found"); + |e| { + info!("Not found: {}", e); "".to_string() }, |v| v.display().to_string(), @@ -228,24 +227,23 @@ fn write_storages_list( } else { "" }; - let typestyle = storage.typestyle(); writeln!( writer, - "{stype}{isremovable:<1}: {name:10} {parent:10} {parent: format!("kind: {}", s.kind()), - Storage::SubDirectory(s) => s.notes.clone(), - Storage::Online(s) => s.provider.clone(), + Storage::Physical(s) => s.kind(), + Storage::SubDirectory(s) => &s.notes, + Storage::Online(s) => &s.provider, }; - writeln!(writer, " {}", style(note).italic())?; + writeln!(writer, " {}", note)?; } } Ok(()) diff --git a/src/cmd_sync.rs b/src/cmd_sync.rs index 6318e59..eb477ca 100644 --- a/src/cmd_sync.rs +++ b/src/cmd_sync.rs @@ -1,79 +1,10 @@ -use std::{ - io::{self, Write}, - path::{Path, PathBuf}, - process, -}; +use std::path::PathBuf; -use anyhow::{Context, Result, anyhow}; -use git2::{Cred, FetchOptions, PushOptions, RemoteCallbacks, Repository, build::CheckoutBuilder}; +use anyhow::{anyhow, Result}; +use git2::Repository; -pub(crate) fn cmd_sync( - config_dir: &PathBuf, - remote_name: Option, - use_sshagent: bool, - ssh_key: Option, - use_libgit2: bool, -) -> Result<()> { - if use_libgit2 { - cmd_sync_custom(config_dir, remote_name, use_sshagent, ssh_key) - } else { - cmd_sync_cl(config_dir, remote_name, ssh_key) - } -} - -fn cmd_sync_cl( - config_dir: &PathBuf, - remote_name: Option, - ssh_key: Option, -) -> Result<()> { - info!("cmd_sync (command line version)"); - - trace!("pull"); - let args = |cmd| { - let mut args = vec![cmd]; - if let Some(ref remote_name) = remote_name { - args.push(remote_name.clone()); - } - if let Some(ref ssh_key) = ssh_key { - args.push("-i".to_string()); - args.push(ssh_key.to_str().unwrap().to_owned()); - } - args - }; - let git_pull_result = process::Command::new("git") - .args(args("pull".to_owned())) - .current_dir(config_dir) - .status() - .context("error while executing git pull")? - .success(); - if git_pull_result { - eprintln!("git pull completed"); - } else { - return Err(anyhow!("failed to complete git pull")); - } - - trace!("push"); - let git_push_result = process::Command::new("git") - .args(args("push".to_owned())) - .current_dir(config_dir) - .status() - .context("error while executing git push")? - .success(); - if git_push_result { - eprintln!("git push completed"); - } else { - return Err(anyhow!("failed to complete git push")); - } - Ok(()) -} - -fn cmd_sync_custom( - config_dir: &PathBuf, - remote_name: Option, - use_sshagent: bool, - ssh_key: Option, -) -> Result<()> { - info!("cmd_sync"); +pub(crate) fn cmd_sync(config_dir: &PathBuf, remote_name: Option) -> Result<()> { + warn!("Experimental"); let repo = Repository::open(config_dir)?; let remote_name = match remote_name { Some(remote_name) => remote_name, @@ -85,252 +16,7 @@ fn cmd_sync_custom( remotes.get(0).unwrap().to_string() } }; - debug!("resolved remote name: {remote_name}"); - let mut remote = repo.find_remote(&remote_name)?; - - pull( - &repo, - &mut remote, - remote_name, - &use_sshagent, - ssh_key.as_ref(), - )?; - - push(&repo, &mut remote, &use_sshagent, ssh_key.as_ref())?; - Ok(()) -} - -fn remote_callback<'b, 'a>( - use_sshagent: &'a bool, - ssh_key: Option<&'a PathBuf>, -) -> RemoteCallbacks<'a> -where - 'b: 'a, -{ - // using credentials - let mut callbacks = RemoteCallbacks::new(); - callbacks - .credentials(move |_url, username_from_url, _allowed_types| { - if let Some(key) = ssh_key { - info!("Using provided ssh key to access the repository"); - let passwd = match inquire::Password::new("SSH passphrase").prompt() { - std::result::Result::Ok(s) => Some(s), - Err(err) => { - error!("Failed to get ssh passphrase: {:?}", err); - None - } - }; - Cred::ssh_key( - username_from_url - .ok_or(git2::Error::from_str("No username found from the url"))?, - None, - key as &Path, - passwd.as_deref(), - ) - } else if *use_sshagent { - // use ssh agent - info!("Using ssh agent to access the repository"); - Cred::ssh_key_from_agent( - username_from_url - .ok_or(git2::Error::from_str("No username found from the url"))?, - ) - } else { - error!("no ssh_key and use_sshagent"); - panic!("This option must be unreachable.") - } - }) - .transfer_progress(|progress| { - if progress.received_objects() == progress.total_objects() { - print!( - "\rResolving deltas {}/{}", - progress.indexed_deltas(), - progress.total_deltas() - ); - } else { - print!( - "\rReceived {}/{} objects ({}) in {} bytes", - progress.received_objects(), - progress.total_objects(), - progress.indexed_objects(), - progress.received_bytes(), - ); - } - io::stderr().flush().unwrap(); - true - }) - .sideband_progress(|text| { - let msg = String::from_utf8_lossy(text); - eprintln!("remote: {msg}"); - true - }) - .push_transfer_progress(|current, total, bytes| { - trace!("{current}/{total} files sent \t{bytes} bytes"); - }) - .push_update_reference(|reference_name, status_msg| { - debug!("remote reference_name {reference_name}"); - match status_msg { - None => { - info!("successfully pushed"); - eprintln!("successfully pushed to {}", reference_name); - Ok(()) - } - Some(status) => { - error!("failed to push: {}", status); - Err(git2::Error::from_str(&format!( - "failed to push to {}: {}", - reference_name, status - ))) - } - } - }); - callbacks -} - -fn pull( - repo: &Repository, - remote: &mut git2::Remote, - remote_name: String, - use_sshagent: &bool, - ssh_key: Option<&PathBuf>, -) -> Result<()> { - debug!("pull"); - let callbacks = remote_callback(use_sshagent, ssh_key); - let mut fetchoptions = FetchOptions::new(); - fetchoptions.remote_callbacks(callbacks); - let fetch_refspec: Vec = remote - .refspecs() - .filter_map(|rs| match rs.direction() { - git2::Direction::Fetch => rs.str().map(|s| s.to_string()), - git2::Direction::Push => None, - }) - .collect(); - remote - .fetch(&fetch_refspec, Some(&mut fetchoptions), None) - .context("Failed to fetch (pull)")?; - let stats = remote.stats(); - if stats.local_objects() > 0 { - eprintln!( - "\rReceived {}/{} objects in {} bytes (used {} local objects)", - stats.indexed_objects(), - stats.total_objects(), - stats.received_bytes(), - stats.local_objects(), - ); - } else { - eprintln!( - "\rReceived {}/{} objects in {} bytes", - stats.indexed_objects(), - stats.total_objects(), - stats.received_bytes(), - ); - } - let fetch_head = repo - .reference_to_annotated_commit( - &repo - .resolve_reference_from_short_name(&remote_name) - .context("failed to get reference from fetch refspec")?, - ) - .context("failed to get annotated commit")?; - let (merge_analysis, merge_preference) = repo - .merge_analysis(&[&fetch_head]) - .context("failed to do merge_analysis")?; - - trace!("merge analysis: {:?}", merge_analysis); - trace!("merge preference: {:?}", merge_preference); - match merge_analysis { - ma if ma.is_up_to_date() => { - info!("HEAD is up to date. skip merging"); - } - ma if ma.is_fast_forward() => { - // https://github.com/rust-lang/git2-rs/blob/master/examples/pull.rs - info!("fast forward is available"); - let mut ref_remote = repo - .find_reference( - remote - .default_branch() - .context("failed to get remote default branch")? - .as_str() - .unwrap(), - ) - .context("failed to get remote reference")?; - let name = match ref_remote.name() { - Some(s) => s.to_string(), - None => String::from_utf8_lossy(ref_remote.name_bytes()).to_string(), - }; - let msg = format!("Fast-Forward: Setting {} to id: {}", name, fetch_head.id()); - eprintln!("{}", msg); - ref_remote - .set_target(fetch_head.id(), &msg) - .context("failed to set target")?; - repo.checkout_head(Some(CheckoutBuilder::default().force())) - .context("failed to checkout")?; - } - ma if ma.is_unborn() => { - warn!("HEAD is invalid (unborn)"); - return Err(anyhow!( - "HEAD is invalid: merge_analysis: {:?}", - merge_analysis - )); - } - ma if ma.is_none() => { - error!("no merge is possible"); - return Err(anyhow!("no merge is possible")); - } - ma if ma.is_normal() => { - error!("unable to fast-forward. manual merge is required"); - return Err(anyhow!("unable to fast-forward. manual merge is required")); - } - _ma => { - error!( - "this code must not reachable: merge_analysis {:?}", - merge_analysis - ); - return Err(anyhow!("must not be reachabel (uncovered merge_analysis)")); - } - } - Ok(()) -} - -fn push( - repo: &Repository, - remote: &mut git2::Remote, - use_sshagent: &bool, - ssh_key: Option<&PathBuf>, -) -> Result<()> { - debug!("push"); - let callbacks = remote_callback(use_sshagent, ssh_key); - let mut push_options = PushOptions::new(); - push_options.remote_callbacks(callbacks); - let num_push_refspecs = remote - .refspecs() - .filter(|rs| rs.direction() == git2::Direction::Push) - .count(); - if num_push_refspecs > 1 { - warn!("more than one push refspecs are configured"); - warn!("using the first one"); - } - let head = repo.head().context("Failed to get HEAD")?; - if num_push_refspecs >= 1 { - trace!("using push refspec"); - let push_refspec = remote - .refspecs() - .filter_map(|rs| match rs.direction() { - git2::Direction::Fetch => None, - git2::Direction::Push => Some(rs), - }) - .next() - .expect("this must be unreachabe") - .str() - .context("failed to get valid utf8 push refspec")? - .to_string(); - remote.push(&[push_refspec.as_str()] as &[&str], Some(&mut push_options))?; - } else { - trace!("using head as push refspec"); - trace!("head is branch: {:?}", head.is_branch()); - trace!("head is remote: {:?}", head.is_remote()); - let push_refspec = head.name().context("failed to get head name")?; - remote.push(&[push_refspec] as &[&str], Some(&mut push_options))?; - }; + remote.push(&[] as &[&str], None)?; Ok(()) } diff --git a/src/git.rs b/src/git.rs deleted file mode 100644 index 4ff8970..0000000 --- a/src/git.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::path::{Path, PathBuf}; - -use git2::{Cred, RemoteCallbacks}; -use inquire::Password; - -pub(crate) fn get_credential<'a>( - use_sshagent: bool, - ssh_key: Option, -) -> RemoteCallbacks<'a> { - // using credentials - let mut callbacks = RemoteCallbacks::new(); - callbacks.credentials(move |_url, username_from_url, _allowed_types| { - if let Some(key) = &ssh_key { - info!("Using provided ssh key to access the repository"); - let passwd = match Password::new("SSH passphrase").prompt() { - std::result::Result::Ok(s) => Some(s), - Err(err) => { - error!("Failed to get ssh passphrase: {:?}", err); - None - } - }; - Cred::ssh_key( - username_from_url.ok_or(git2::Error::from_str("No username found from the url"))?, - None, - key as &Path, - passwd.as_deref(), - ) - } else if use_sshagent { - // use ssh agent - info!("Using ssh agent to access the repository"); - Cred::ssh_key_from_agent( - username_from_url.ok_or(git2::Error::from_str("No username found from the url"))?, - ) - } else { - error!("no ssh_key and use_sshagent"); - panic!("This option must be unreachable.") - } - }); - callbacks -} diff --git a/src/main.rs b/src/main.rs index 7c8d47e..18e332d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,7 @@ use std::path::{self, PathBuf}; use storages::Storages; use crate::cmd_args::{BackupSubCommands, Cli, Commands, StorageCommands}; -use devices::{DEVICESFILE, Device}; +use devices::{Device, DEVICESFILE, *}; mod backups; mod cmd_args; @@ -31,11 +31,9 @@ mod cmd_backup; mod cmd_check; mod cmd_completion; mod cmd_init; -mod cmd_status; mod cmd_storage; mod cmd_sync; mod devices; -mod git; mod inquire_filepath_completer; mod storages; mod util; @@ -92,17 +90,7 @@ fn main() -> Result<()> { Commands::Path {} => { println!("{}", &config_dir.display()); } - Commands::Sync { - remote_name, - use_libgit2, - use_sshagent, - ssh_key, - } => cmd_sync::cmd_sync(&config_dir, remote_name, use_sshagent, ssh_key, use_libgit2)?, - Commands::Status { - path, - storage, - backup, - } => cmd_status::cmd_status(path, storage, backup, &config_dir)?, + Commands::Sync { remote_name } => cmd_sync::cmd_sync(&config_dir, remote_name)?, Commands::Check {} => cmd_check::cmd_check(&config_dir)?, Commands::Backup(backup) => { trace!("backup subcommand with args: {:?}", backup); @@ -162,7 +150,7 @@ fn add_and_commit(repo: &Repository, path: &Path, message: &str) -> Result "O", } } - - pub fn typestyle(&self) -> Style { - match self { - Storage::Physical(_) => Style::new().cyan(), - Storage::SubDirectory(_) => Style::new().yellow(), - Storage::Online(_) => Style::new().green(), - } - } } impl StorageExt for Storage { @@ -78,7 +69,7 @@ impl StorageExt for Storage { } } - fn mount_path(&self, device: &devices::Device) -> Option { + fn mount_path(&self, device: &devices::Device) -> Result { match self { Self::Physical(s) => s.mount_path(device), Self::SubDirectory(s) => s.mount_path(device), @@ -144,8 +135,8 @@ pub trait StorageExt { fn local_info(&self, device: &devices::Device) -> Option<&local_info::LocalInfo>; /// Get mount path of `self` on `device`. - /// Return [`None`] if the storage([`self`]) is not configured for the `device`. - fn mount_path(&self, device: &devices::Device) -> Option; + /// `storages` is a `BTreeMap` with key of storage name and value of the storage. + fn mount_path(&self, device: &devices::Device) -> Result; /// Add local info of `device` to `self`. fn bound_on_device( @@ -156,7 +147,7 @@ pub trait StorageExt { ) -> Result<()>; /// Get parent - fn parent<'a>(&'a self, storages: &'a Storages) -> Option<&'a Storage>; + fn parent<'a>(&'a self, storages: &'a Storages) -> Option<&Storage>; } pub mod directory; diff --git a/src/storages/directory.rs b/src/storages/directory.rs index 1642518..7887c7b 100644 --- a/src/storages/directory.rs +++ b/src/storages/directory.rs @@ -2,7 +2,6 @@ use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; -use std::path::PathBuf; use std::{collections::BTreeMap, fmt, path}; use crate::devices; @@ -18,9 +17,9 @@ pub struct Directory { /// ID of parent storage. parent: String, /// Relative path to the parent storage. - relative_path: Vec, + relative_path: path::PathBuf, pub notes: String, - /// [`devices::Device`] name and localinfo pairs. + /// Device and localinfo pairs. local_infos: BTreeMap, } @@ -35,19 +34,14 @@ impl Directory { relative_path: path::PathBuf, notes: String, local_infos: BTreeMap, - ) -> Result { - let relative_path = relative_path - .components() - .map(|c| c.as_os_str().to_str().map(|s| s.to_owned())) - .collect::>>() - .context("Path contains non-utf8 character")?; - Ok(Directory { + ) -> Directory { + Directory { name, parent, relative_path, notes, local_infos, - }) + } } pub fn try_from_device_path( @@ -62,23 +56,23 @@ impl Directory { .context("Failed to compare diff of paths")?; trace!("Selected parent: {}", parent.name()); let local_info = LocalInfo::new(alias, path); - Directory::new( + Ok(Directory::new( name, parent.name().to_string(), diff_path, notes, BTreeMap::from([(device.name(), local_info)]), - ) + )) } pub fn update_note(self, notes: String) -> Directory { - Directory { - name: self.name, - parent: self.parent, - relative_path: self.relative_path, + Directory::new( + self.name, + self.parent, + self.relative_path, notes, - local_infos: self.local_infos, - } + self.local_infos, + ) } /// Resolve mount path of directory with current device. @@ -86,9 +80,8 @@ impl Directory { let parent_mount_path = self .parent(storages) .context("Can't find parent storage")? - .mount_path(device) - .context("Can't find mount path")?; - Ok(parent_mount_path.join(self.relative_path.clone().iter().collect::())) + .mount_path(device)?; + Ok(parent_mount_path.join(self.relative_path.clone())) } } @@ -105,10 +98,12 @@ impl StorageExt for Directory { self.local_infos.get(&device.name()) } - fn mount_path(&self, device: &devices::Device) -> Option { - self.local_infos + fn mount_path(&self, device: &devices::Device) -> Result { + Ok(self + .local_infos .get(&device.name()) - .map(|info| info.mount_path()) + .context(format!("LocalInfo for storage: {} not found", &self.name()))? + .mount_path()) } /// This method doesn't use `mount_path`. @@ -127,7 +122,7 @@ impl StorageExt for Directory { } // Get parent `&Storage` of directory. - fn parent<'a>(&'a self, storages: &'a Storages) -> Option<&'a Storage> { + fn parent<'a>(&'a self, storages: &'a Storages) -> Option<&Storage> { storages.get(&self.parent) } } @@ -139,7 +134,7 @@ impl fmt::Display for Directory { "S {name:<10} < {parent:<10}{relative_path:<10} : {notes}", name = self.name(), parent = self.parent, - relative_path = self.relative_path.iter().collect::().display(), + relative_path = self.relative_path.display(), notes = self.notes, ) } @@ -183,10 +178,11 @@ mod test { "subdir".into(), "some note".to_string(), local_infos, - ) - .unwrap(); + ); let mut storages = Storages::new(); - storages.add(storages::Storage::Physical(physical)).unwrap(); + storages + .add(storages::Storage::Physical(physical)) + .unwrap(); storages.add(Storage::SubDirectory(directory)).unwrap(); // assert_eq!(directory.name(), "test_name"); assert_eq!( diff --git a/src/storages/online_storage.rs b/src/storages/online_storage.rs index afedf16..4ce2459 100644 --- a/src/storages/online_storage.rs +++ b/src/storages/online_storage.rs @@ -1,6 +1,6 @@ //! Online storage which is not a children of any physical drive. -use anyhow::Result; +use anyhow::{Context, Result}; use byte_unit::Byte; use byte_unit::UnitType; use serde::{Deserialize, Serialize}; @@ -61,10 +61,12 @@ impl StorageExt for OnlineStorage { self.local_infos.get(&device.name()) } - fn mount_path(&self, device: &devices::Device) -> Option { - self.local_infos + fn mount_path(&self, device: &devices::Device) -> Result { + Ok(self + .local_infos .get(&device.name()) - .map(|info| info.mount_path()) + .context(format!("LocalInfo for storage: {} not found", &self.name()))? + .mount_path()) } fn bound_on_device( diff --git a/src/storages/physical_drive_partition.rs b/src/storages/physical_drive_partition.rs index 14a35a6..95dec3f 100644 --- a/src/storages/physical_drive_partition.rs +++ b/src/storages/physical_drive_partition.rs @@ -21,7 +21,6 @@ pub struct PhysicalDrivePartition { fs: String, is_removable: bool, // system_names: BTreeMap, - /// [`Device`] name and [`LocalInfo`] mapping. local_infos: BTreeMap, } @@ -113,10 +112,12 @@ impl StorageExt for PhysicalDrivePartition { self.local_infos.get(&device.name()) } - fn mount_path(&self, device: &devices::Device) -> Option { - self.local_infos + fn mount_path(&self, device: &devices::Device) -> Result { + Ok(self + .local_infos .get(&device.name()) - .map(|info| info.mount_path()) + .context(format!("LocalInfo for storage: {} not found", &self.name()))? + .mount_path()) } fn bound_on_device( diff --git a/src/util.rs b/src/util.rs index ea2c947..36c6714 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,8 +1,6 @@ use std::path::{self, PathBuf}; use anyhow::{Context, Result}; -use chrono::TimeDelta; -use console::Style; use crate::{ devices::Device, @@ -19,12 +17,12 @@ pub fn min_parent_storage<'a>( .list .iter() .filter_map(|(k, storage)| { - let storage_path = storage.mount_path(device)?; + let storage_path = match storage.mount_path(device) { + Ok(path) => path, + Err(_) => return None, + }; let diff = pathdiff::diff_paths(path, storage_path)?; - if diff - .components() - .any(|c| matches!(c, path::Component::ParentDir | path::Component::Prefix(_))) - { + if diff.components().any(|c| c == path::Component::ParentDir) { None } else { Some((k, diff)) @@ -63,17 +61,6 @@ pub fn format_summarized_duration(dt: chrono::Duration) -> String { } } -pub fn duration_style(time: TimeDelta) -> Style { - match time { - x if x < TimeDelta::days(7) => Style::new().green(), - x if x < TimeDelta::days(14) => Style::new().yellow(), - x if x < TimeDelta::days(28) => Style::new().magenta(), - x if x < TimeDelta::days(28 * 3) => Style::new().red(), - x if x < TimeDelta::days(180) => Style::new().red().bold(), - _ => Style::new().on_red().black(), - } -} - #[cfg(test)] mod test { use anyhow::Result; diff --git a/tests/cli.rs b/tests/cli.rs index 4582915..45bc945 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -1,62 +1,27 @@ mod integrated_test { use std::{ - fs::{self, DirBuilder, File}, + fs::{DirBuilder, File}, io::{self, BufWriter, Write}, - path, }; - use anyhow::{Context, Ok, Result, anyhow}; - use assert_cmd::{Command, assert::OutputAssertExt}; + use anyhow::{Context, Ok, Result}; + use assert_cmd::{assert::OutputAssertExt, Command}; + use dirs::home_dir; use git2::Repository; - use log::{debug, trace}; - use predicates::{boolean::PredicateBooleanExt, prelude::predicate}; - - const IS_GIT_CONFIG_WRITABLE: &str = "XDBM_ENABLE_OVERWRITE_GITCONFIG"; + use log::trace; + use predicates::prelude::predicate; /// Setup global gitconfig if it doesn't exist. /// /// # Errors /// - /// This function will return an error if it failed to get git global config and environment - /// variable [XDBM_ENABLE_OVERWRITE_GITCONFIG](`IS_GIT_CONFIG_WRITABLE`) is not set. + /// This function will return an error if it failed to get home directory. fn setup_gitconfig() -> Result<()> { - let config = git2::Config::open_default().expect("failed to get default"); - if config.get_string("user.name").is_ok() && config.get_string("user.email").is_ok() { - return Ok(()); - }; - - match std::env::var_os(IS_GIT_CONFIG_WRITABLE) { - Some(_) => { - debug!( - "global git config not found & env var `{}` found", - IS_GIT_CONFIG_WRITABLE - ); - } - None => { - eprintln!("Failed to get git global config"); - eprintln!( - "Set env var `{}` to set automatically (mainly for CI)", - IS_GIT_CONFIG_WRITABLE - ); - return Err(anyhow!("failed to get git global config")); - } - }; - - let config_file = git2::Config::find_global().map_or_else( - |e| { - trace!("global git config file not found: {e:?}"); - Ok(dirs::home_dir() - .context("Failed to get home dir")? - .join(".gitconfig")) - }, - Ok, - )?; - let f = match File::options() - .create(true) - .truncate(true) - .write(true) - .open(config_file) - { + let f = match File::create_new( + home_dir() + .context("Failed to find home directory")? + .join(".gitconfig"), + ) { io::Result::Ok(f) => f, io::Result::Err(_err) => return Ok(()), }; @@ -73,25 +38,6 @@ mod integrated_test { Ok(()) } - fn run_sync_cmd(config_dir: &path::Path, use_cl: bool) -> Result<()> { - if use_cl { - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir) - .args(["sync", "-vvvv"]) - .assert() - .success(); - } else { - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir) - .args(["sync", "-vvvv", "-u"]) - .assert() - .success(); - } - Ok(()) - } - #[test] fn single_device() -> Result<()> { let config_dir = assert_fs::TempDir::new()?; @@ -101,10 +47,8 @@ mod integrated_test { cmd.arg("-c") .arg(config_dir.path()) .arg("init") - .arg("testdev") - .arg("-vvvv"); + .arg("testdev"); cmd.assert().success().stdout(predicate::str::contains("")); - eprintln!("{:?}", fs::read_dir(config_dir.path())?.collect::>()); assert_eq!( std::fs::read_to_string(config_dir.path().join("devname"))?, "testdev\n" @@ -201,7 +145,7 @@ mod integrated_test { // bare-repo let bare_repo_dir = assert_fs::TempDir::new()?; - let _bare_repo = Repository::init_bare(&bare_repo_dir)?; + let bare_repo = Repository::init_bare(&bare_repo_dir)?; // push to bare repository let repo_1 = Repository::open(&config_dir_1)?; let upstream_name = "remote"; @@ -213,14 +157,7 @@ mod integrated_test { // set up upstream branch let (mut repo_1_branch, _branch_type) = repo_1.branches(None)?.next().unwrap()?; println!("head {}", repo_1.head().unwrap().name().unwrap()); - repo_1_branch.set_upstream(Some( - format!( - "{}/{}", - upstream_name, - repo_1_branch.name().unwrap().unwrap() - ) - .as_str(), - ))?; + repo_1_branch.set_upstream(Some(format!("{}/{}", upstream_name, repo_1_branch.name().unwrap().unwrap()).as_str()))?; // 2nd device let config_dir_2 = assert_fs::TempDir::new()?; @@ -272,8 +209,6 @@ mod integrated_test { #[test] fn two_devices() -> Result<()> { // 1st device - // - // devices: first let config_dir_1 = assert_fs::TempDir::new()?; setup_gitconfig()?; let mut cmd1 = Command::cargo_bin("xdbm")?; @@ -285,7 +220,7 @@ mod integrated_test { // bare-repo let bare_repo_dir = assert_fs::TempDir::new()?; - let _bare_repo = Repository::init_bare(&bare_repo_dir)?; + let bare_repo = Repository::init_bare(&bare_repo_dir)?; // push to bare repository let repo_1 = Repository::open(&config_dir_1)?; let upstream_name = "remote"; @@ -296,20 +231,10 @@ mod integrated_test { println!("{:?}", bare_repo_dir.read_dir()?); // set up upstream branch let (mut repo_1_branch, _branch_type) = repo_1.branches(None)?.next().unwrap()?; - repo_1_branch.set_upstream(Some( - format!( - "{}/{}", - upstream_name, - repo_1_branch.name().unwrap().unwrap() - ) - .as_str(), - ))?; + repo_1_branch.set_upstream(Some(format!("{}/{}", upstream_name, repo_1_branch.name().unwrap().unwrap()).as_str()))?; // 2nd device - // - // devices: first, second let config_dir_2 = assert_fs::TempDir::new()?; - setup_gitconfig()?; let mut cmd2 = Command::cargo_bin("xdbm")?; cmd2.arg("-c") .arg(config_dir_2.path()) @@ -332,16 +257,15 @@ mod integrated_test { assert!(config_dir_2.join("backups").join("first.yml").exists()); assert!(config_dir_2.join("backups").join("second.yml").exists()); - // sync - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("sync") - .arg("-vvvv") - .arg("-u") + std::process::Command::new("git") + .arg("push") + .current_dir(&config_dir_2) .assert() - .success() - .stderr(predicate::str::contains("successfully pushed")); + .success(); + // let repo_2 = Repository::open(config_dir_2)?; + // // return Err(anyhow!("{:?}", repo_2.remotes()?.iter().collect::>())); + // let mut repo_2_remote = repo_2.find_remote(repo_2.remotes()?.get(0).unwrap())?; + // repo_2_remote.push(&[] as &[&str], None)?; std::process::Command::new("git") .arg("pull") .current_dir(&config_dir_1) @@ -349,11 +273,6 @@ mod integrated_test { .success(); // Add storage - // - // devices: first, second - // storages: - // - gdrive @ sample_storage (online) - // - first: sample_storage let sample_storage = assert_fs::TempDir::new()?; let mut cmd_add_storage_1 = Command::cargo_bin("xdbm")?; cmd_add_storage_1 @@ -375,13 +294,6 @@ mod integrated_test { .success() .stdout(predicate::str::contains("")); // Add storage (directory) - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first let sample_directory = &sample_storage.join("foo").join("bar"); DirBuilder::new().recursive(true).create(sample_directory)?; Command::cargo_bin("xdbm")? @@ -401,18 +313,18 @@ mod integrated_test { std::fs::read_to_string(config_dir_1.join("storages.yml"))?.contains("parent: gdrive1") ); - run_sync_cmd(&config_dir_1, false)?; - run_sync_cmd(&config_dir_2, false)?; + std::process::Command::new("git") + .arg("push") + .current_dir(&config_dir_1) + .assert() + .success(); + std::process::Command::new("git") + .arg("pull") + .current_dir(&config_dir_2) + .assert() + .success(); // bind - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory Command::cargo_bin("xdbm")? .arg("-c") .arg(config_dir_2.path()) @@ -428,16 +340,6 @@ mod integrated_test { .stdout(predicate::str::contains("")); // storage 3 - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory - // - nas (online) - // - second: sample_storage_2 let sample_storage_2 = assert_fs::TempDir::new()?; Command::cargo_bin("xdbm")? .arg("-c") @@ -456,7 +358,6 @@ mod integrated_test { .assert() .success(); - // storage list Command::cargo_bin("xdbm")? .arg("-c") .arg(config_dir_2.path()) @@ -464,23 +365,8 @@ mod integrated_test { .arg("list") .arg("-l") .assert() - .success() - .stdout(predicate::str::contains("gdrive_docs").and(predicate::str::contains("nas"))); - + .success(); // backup add - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory - // - nas (online) - // - second: sample_storage_2 - // backups: - // - foodoc: second - // - sample_storage_2/foo/bar -> sample_directory/docs let backup_src = &sample_storage_2.join("foo").join("bar"); DirBuilder::new().recursive(true).create(backup_src)?; let backup_dest = &sample_directory.join("docs"); @@ -501,7 +387,6 @@ mod integrated_test { .assert() .success(); - // backup add but with existing name Command::cargo_bin("xdbm")? .arg("-c") .arg(config_dir_2.path()) @@ -519,297 +404,6 @@ mod integrated_test { .failure() .stderr(predicate::str::contains("already")); - // backup list - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("backup") - .arg("list") - .assert() - .success() - .stdout( - predicate::str::contains("foodoc") - .and(predicate::str::contains("nas")) - .and(predicate::str::contains("gdrive_docs")) - .and(predicate::str::contains("---")), - ); - - // backup done - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory - // - nas (online) - // - second: sample_storage_2 - // backups: - // - foodoc: second - // - sample_storage_2/foo/bar -> sample_directory/docs (done 1) - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("backup") - .arg("done") - .arg("foodoc") - .arg("0") - .assert() - .success(); - - // backup list after backup done - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("backup") - .arg("list") - .assert() - .success() - .stdout( - predicate::str::contains("foodoc") - .and(predicate::str::contains("nas")) - .and(predicate::str::contains("gdrive_docs")) - .and(predicate::str::contains("---").not()), - ); - - // status - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("status") - .assert() - .success(); - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("status") - .arg("-s") - .arg(backup_src.clone().join("foo")) - .assert() - .success() - .stdout(predicate::str::contains("nas").and(predicate::str::contains("foodoc").not())); - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("status") - .arg("-sb") - .arg(backup_src.clone().join("foo")) - .assert() - .success() - .stdout( - predicate::str::contains("nas") - .and(predicate::str::contains("second")) - .and(predicate::str::contains("foodoc")), - ); - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("status") - .arg("-sb") - .arg(backup_src.clone().parent().unwrap()) - .assert() - .success() - .stdout( - predicate::str::contains("nas") - .and(predicate::str::contains("second").not()) - .and(predicate::str::contains("foodoc").not()), - ); - - run_sync_cmd(&config_dir_2, true)?; - run_sync_cmd(&config_dir_1, true)?; - - // bind - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory - // - nas (online) - // - first: sample_storage_2_first_path - // - second: sample_storage_2 - // backups: - // - foodoc: second - // - sample_storage_2/foo/bar -> sample_directory/docs (done 1) - let sample_storage_2_first_path = assert_fs::TempDir::new()?; - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_1.path()) - .arg("storage") - .arg("bind") - .arg("--alias") - .arg("sample2") - .arg("--path") - .arg(sample_storage_2_first_path.path()) - .arg("nas") - .assert() - .success() - .stdout(predicate::str::contains("")); - - // backup add - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory - // - nas (online) - // - first: sample_storage_2_first_path - // - second: sample_storage_2 - // backups: - // - foodoc: second - // - sample_storage_2/foo/bar -> sample_directory/docs (done 1) - // - abcdbackup: first - // - sample_storage_2_first_path/abcd/efgh -> sample_storage/Downloads/abcd/efgh - let backup_src = &sample_storage_2_first_path.join("abcd").join("efgh"); - DirBuilder::new().recursive(true).create(backup_src)?; - let backup_dest = &sample_storage.join("Downloads").join("abcd").join("efgh"); - DirBuilder::new().recursive(true).create(backup_dest)?; - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_1.path()) - .arg("backup") - .arg("add") - .arg("--src") - .arg(backup_src) - .arg("--dest") - .arg(backup_dest) - .arg("abcdbackup") - .arg("external") - .arg("rsync") - .arg("note: nonsense") - .assert() - .success(); - - // backup add - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory - // - nas (online) - // - first: sample_storage_2_first_path - // - second: sample_storage_2 - // backups: - // - foodoc: second - // - sample_storage_2/foo/bar -> sample_directory/docs (done 1) - // - abcdbackup: first - // - sample_storage_2_first_path/abcd/efgh -> sample_storage/Downloads/abcd/efgh - // - abcdsubbackup: first - // - sample_storage_2_first_path/abcd/efgh/sub -> sample_storage/Downloads/abcd/efgh/sub - let backup_src = &sample_storage_2_first_path - .join("abcd") - .join("efgh") - .join("sub"); - DirBuilder::new().recursive(true).create(backup_src)?; - let backup_dest = &sample_storage - .join("Downloads") - .join("abcd") - .join("efgh") - .join("sub"); - DirBuilder::new().recursive(true).create(backup_dest)?; - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_1.path()) - .arg("backup") - .arg("add") - .arg("--src") - .arg(backup_src) - .arg("--dest") - .arg(backup_dest) - .arg("abcdsubbackup") - .arg("external") - .arg("rsync") - .arg("note: only subdirectory") - .assert() - .success(); - - run_sync_cmd(&config_dir_1, false)?; - run_sync_cmd(&config_dir_2, false)?; - - // backup add - // - // devices: first, second - // storages: - // - gdrive (online) - // - first: sample_storage - // - gdrive_docs (subdir of sample_storage/foo/bar) - // - first - // - second: sample_directory - // - nas (online) - // - first: sample_storage_2_first_path - // - second: sample_storage_2 - // backups: - // - foodoc: second - // - sample_storage_2/foo/bar -> sample_directory/docs (done 1) - // - abcdbackup: first - // - sample_storage_2_first_path/abcd/efgh -> sample_storage/Downloads/abcd/efgh - // - abcdsubbackup: first - // - sample_storage_2_first_path/abcd/efgh/sub -> sample_storage/Downloads/abcd/efgh/sub - // - abcdbackup2: second - // - sample_storage_2/abcd/efgh -> sample_directory/Downloads/abcd/efgh - let backup_src = &sample_storage_2.join("abcd").join("efgh"); - DirBuilder::new().recursive(true).create(backup_src)?; - let backup_dest = &sample_directory.join("Downloads").join("abcd").join("efgh"); - DirBuilder::new().recursive(true).create(backup_dest)?; - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("backup") - .arg("add") - .arg("--src") - .arg(backup_src) - .arg("--dest") - .arg(backup_dest) - .arg("abcdbackup2") - .arg("external") - .arg("rsync") - .arg("note: only subdirectory") - .assert() - .success(); - - // status - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("status") - .arg("-sb") - .arg(backup_src) - .assert() - .success() - .stdout( - predicate::str::contains("nas") - .and(predicate::str::contains("first")) - .and(predicate::str::contains("abcdbackup")) - .and(predicate::str::contains("abcdsubbackup").not()) - .and(predicate::str::contains("second")) - .and(predicate::str::contains("abcdbackup2")), - ); - Command::cargo_bin("xdbm")? - .arg("-c") - .arg(config_dir_2.path()) - .arg("status") - .arg("-sb") - .arg(backup_src.join("sub")) - .assert() - .success() - .stdout( - predicate::str::contains("nas") - .and(predicate::str::contains("first")) - .and(predicate::str::contains("abcdbackup")) - .and(predicate::str::contains("abcdsubbackup")) - .and(predicate::str::contains("second")) - .and(predicate::str::contains("abcdbackup2")), - ); - Ok(()) } }