Compare commits
9 Commits
d1274f4ad9
...
1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
679aa4ae65
|
|||
|
e9c908e562
|
|||
|
cbab42c25e
|
|||
|
2f560c1279
|
|||
|
8ccf64c28b
|
|||
|
ba7c2d4b71
|
|||
|
3435f1d4e6
|
|||
|
770cf5ea0e
|
|||
|
22a0cbc07b
|
750
Cargo.lock
generated
750
Cargo.lock
generated
@ -3,23 +3,90 @@
|
|||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "addr2line"
|
||||||
version = "0.7.18"
|
version = "0.21.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
|
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
|
||||||
|
dependencies = [
|
||||||
|
"gimli",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "adler"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aho-corasick"
|
||||||
|
version = "1.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "android-tzdata"
|
||||||
version = "0.2.14"
|
version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "android_system_properties"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi",
|
|
||||||
"libc",
|
"libc",
|
||||||
"winapi",
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstream"
|
||||||
|
version = "0.6.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44"
|
||||||
|
dependencies = [
|
||||||
|
"anstyle",
|
||||||
|
"anstyle-parse",
|
||||||
|
"anstyle-query",
|
||||||
|
"anstyle-wincon",
|
||||||
|
"colorchoice",
|
||||||
|
"utf8parse",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstyle"
|
||||||
|
version = "1.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstyle-parse"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140"
|
||||||
|
dependencies = [
|
||||||
|
"utf8parse",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstyle-query"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
|
||||||
|
dependencies = [
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstyle-wincon"
|
||||||
|
version = "3.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628"
|
||||||
|
dependencies = [
|
||||||
|
"anstyle",
|
||||||
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -29,10 +96,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "backtrace"
|
||||||
version = "1.3.2"
|
version = "0.3.69"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
|
||||||
|
dependencies = [
|
||||||
|
"addr2line",
|
||||||
|
"cc",
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"miniz_oxide",
|
||||||
|
"object",
|
||||||
|
"rustc-demangle",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "2.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bumpalo"
|
||||||
|
version = "3.14.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.0.83"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
@ -42,111 +139,226 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.19"
|
version = "0.4.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
|
checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"android-tzdata",
|
||||||
"num-integer",
|
"iana-time-zone",
|
||||||
|
"js-sys",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"time",
|
"wasm-bindgen",
|
||||||
"winapi",
|
"windows-targets",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "3.1.8"
|
version = "4.4.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "71c47df61d9e16dc010b55dba1952a57d8c215dbb533fd13cdd13369aac73b1c"
|
checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"clap_builder",
|
||||||
"bitflags",
|
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
"indexmap",
|
]
|
||||||
"lazy_static",
|
|
||||||
"os_str_bytes",
|
[[package]]
|
||||||
|
name = "clap_builder"
|
||||||
|
version = "4.4.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45"
|
||||||
|
dependencies = [
|
||||||
|
"anstream",
|
||||||
|
"anstyle",
|
||||||
|
"clap_lex",
|
||||||
"strsim",
|
"strsim",
|
||||||
"termcolor",
|
|
||||||
"textwrap",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "3.1.7"
|
version = "4.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1"
|
checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro-error",
|
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "env_logger"
|
name = "clap_lex"
|
||||||
version = "0.7.1"
|
version = "0.5.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
|
checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "color-eyre"
|
||||||
|
version = "0.6.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204"
|
||||||
|
dependencies = [
|
||||||
|
"backtrace",
|
||||||
|
"color-spantrace",
|
||||||
|
"eyre",
|
||||||
|
"indenter",
|
||||||
|
"once_cell",
|
||||||
|
"owo-colors",
|
||||||
|
"tracing-error",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "color-spantrace"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"owo-colors",
|
||||||
|
"tracing-core",
|
||||||
|
"tracing-error",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "colorchoice"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core-foundation-sys"
|
||||||
|
version = "0.8.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "env_logger"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"humantime",
|
"humantime",
|
||||||
|
"is-terminal",
|
||||||
"log",
|
"log",
|
||||||
"regex",
|
"regex",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "file_reap"
|
name = "errno"
|
||||||
version = "0.1.0"
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"errno-dragonfly",
|
||||||
"clap",
|
"libc",
|
||||||
"log",
|
"windows-sys",
|
||||||
"pretty_env_logger",
|
|
||||||
"serde",
|
|
||||||
"thiserror",
|
|
||||||
"toml",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "errno-dragonfly"
|
||||||
version = "0.11.2"
|
version = "0.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
|
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "heck"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "hermit-abi"
|
|
||||||
version = "0.1.19"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "humantime"
|
name = "eyre"
|
||||||
version = "1.3.0"
|
version = "0.6.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
|
checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quick-error",
|
"indenter",
|
||||||
|
"once_cell",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "filereap"
|
||||||
version = "1.8.1"
|
version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"chrono",
|
||||||
"hashbrown",
|
"clap",
|
||||||
|
"color-eyre",
|
||||||
|
"eyre",
|
||||||
|
"log",
|
||||||
|
"pretty_env_logger",
|
||||||
|
"serde",
|
||||||
|
"toml",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gimli"
|
||||||
|
version = "0.28.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "heck"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hermit-abi"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "humantime"
|
||||||
|
version = "2.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iana-time-zone"
|
||||||
|
version = "0.1.57"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613"
|
||||||
|
dependencies = [
|
||||||
|
"android_system_properties",
|
||||||
|
"core-foundation-sys",
|
||||||
|
"iana-time-zone-haiku",
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"windows",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iana-time-zone-haiku"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "indenter"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is-terminal"
|
||||||
|
version = "0.4.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"rustix",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "js-sys"
|
||||||
|
version = "0.3.64"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
|
||||||
|
dependencies = [
|
||||||
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -157,116 +369,118 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.123"
|
version = "0.2.148"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cb691a747a7ab48abc15c5b42066eaafde10dc427e3b6ee2a1cf43db04c763bd"
|
checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.4.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.16"
|
version = "0.4.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8"
|
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.4.1"
|
version = "2.6.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-integer"
|
name = "miniz_oxide"
|
||||||
version = "0.1.44"
|
version = "0.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
|
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"adler",
|
||||||
"num-traits",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
version = "0.2.14"
|
version = "0.2.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
|
checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "os_str_bytes"
|
name = "object"
|
||||||
version = "6.0.0"
|
version = "0.32.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
|
checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pretty_env_logger"
|
name = "once_cell"
|
||||||
version = "0.4.0"
|
version = "1.18.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d"
|
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "owo-colors"
|
||||||
|
version = "3.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-project-lite"
|
||||||
|
version = "0.2.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pretty_env_logger"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "proc-macro-error"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro-error-attr",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
"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]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.37"
|
version = "1.0.67"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1"
|
checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "quick-error"
|
|
||||||
version = "1.2.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.18"
|
version = "1.0.33"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
|
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.5.5"
|
version = "1.9.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
|
checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-automata"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@ -275,30 +489,58 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.25"
|
version = "0.7.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc-demangle"
|
||||||
|
version = "0.1.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustix"
|
||||||
|
version = "0.38.17"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"errno",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.136"
|
version = "1.0.188"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
|
checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.136"
|
version = "1.0.188"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
|
checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sharded-slab"
|
||||||
|
version = "0.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
@ -307,87 +549,156 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.91"
|
version = "2.0.37"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d"
|
checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"unicode-xid",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termcolor"
|
name = "termcolor"
|
||||||
version = "1.1.3"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
|
checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textwrap"
|
name = "thread_local"
|
||||||
version = "0.15.0"
|
version = "1.1.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
|
checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "thiserror"
|
|
||||||
version = "1.0.30"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror-impl",
|
"cfg-if",
|
||||||
]
|
"once_cell",
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "thiserror-impl"
|
|
||||||
version = "1.0.30"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "time"
|
|
||||||
version = "0.1.44"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
|
|
||||||
dependencies = [
|
|
||||||
"libc",
|
|
||||||
"wasi",
|
|
||||||
"winapi",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml"
|
name = "toml"
|
||||||
version = "0.5.9"
|
version = "0.5.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
|
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "tracing"
|
||||||
version = "0.2.2"
|
version = "0.1.37"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"pin-project-lite",
|
||||||
|
"tracing-core",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "tracing-core"
|
||||||
version = "0.9.4"
|
version = "0.1.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"valuable",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi"
|
name = "tracing-error"
|
||||||
version = "0.10.0+wasi-snapshot-preview1"
|
version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e"
|
||||||
|
dependencies = [
|
||||||
|
"tracing",
|
||||||
|
"tracing-subscriber",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing-subscriber"
|
||||||
|
version = "0.3.17"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77"
|
||||||
|
dependencies = [
|
||||||
|
"sharded-slab",
|
||||||
|
"thread_local",
|
||||||
|
"tracing-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "utf8parse"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "valuable"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen"
|
||||||
|
version = "0.2.87"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"wasm-bindgen-macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-backend"
|
||||||
|
version = "0.2.87"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
|
||||||
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
|
"log",
|
||||||
|
"once_cell",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro"
|
||||||
|
version = "0.2.87"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"wasm-bindgen-macro-support",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro-support"
|
||||||
|
version = "0.2.87"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-backend",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-shared"
|
||||||
|
version = "0.2.87"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
@ -407,9 +718,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-util"
|
name = "winapi-util"
|
||||||
version = "0.1.5"
|
version = "0.1.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
@ -419,3 +730,78 @@ name = "winapi-x86_64-pc-windows-gnu"
|
|||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-targets"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm",
|
||||||
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
|
"windows_i686_msvc",
|
||||||
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
|
"windows_x86_64_msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnu"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_msvc"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnu"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_msvc"
|
||||||
|
version = "0.48.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||||
|
|||||||
18
Cargo.toml
18
Cargo.toml
@ -1,13 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "file_reap"
|
name = "filereap"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
authors = ["Joakim Hulthe <joakim@hulthe.net>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1.8", features = ["derive"] }
|
clap = { version = "4.4.6", features = ["derive"] }
|
||||||
chrono = "0.4.19"
|
chrono = "0.4.31"
|
||||||
thiserror = "1.0.30"
|
|
||||||
serde = { version = "1.0.136", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
toml = "0.5.9"
|
toml = "0.5.11"
|
||||||
log = "0.4.16"
|
log = "0.4.20"
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.5.0"
|
||||||
|
eyre = "0.6.8"
|
||||||
|
color-eyre = "0.6.2"
|
||||||
|
|||||||
34
README.md
34
README.md
@ -1,4 +1,36 @@
|
|||||||
# file_reap
|
# filereap
|
||||||
|
|
||||||
Delete dated files in a directory according to a time period config.
|
Delete dated files in a directory according to a time period config.
|
||||||
Useful for backup directories that accumulate files over time.
|
Useful for backup directories that accumulate files over time.
|
||||||
|
|
||||||
|
## Example config
|
||||||
|
```toml
|
||||||
|
# Specify a folder containing backups
|
||||||
|
path = "/backups/docker"
|
||||||
|
|
||||||
|
# uncomment if the backups are btrfs subvolumes
|
||||||
|
#btrfs = true
|
||||||
|
|
||||||
|
[[periods]]
|
||||||
|
# For the first day, keep one backup per second (basically, don't delete backups)
|
||||||
|
# syntax supports suffixes s, m, h, d, w
|
||||||
|
period_length = "1d"
|
||||||
|
chunk_size = "1s"
|
||||||
|
|
||||||
|
[[periods]]
|
||||||
|
# For the next week, keep one backup per hour
|
||||||
|
period_length = "1w"
|
||||||
|
chunk_size = "1h"
|
||||||
|
|
||||||
|
[[periods]]
|
||||||
|
# For the next 4 weeks, keep one backup per day
|
||||||
|
period_length = "4w"
|
||||||
|
chunk_size = "1d"
|
||||||
|
|
||||||
|
# can add more [[periods]] as needed
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
```sh
|
||||||
|
filereap --help
|
||||||
|
```
|
||||||
|
|||||||
17
example.toml
17
example.toml
@ -1,14 +1,23 @@
|
|||||||
path = "./test"
|
# Specify a folder containing backups
|
||||||
|
path = "/backups/docker"
|
||||||
|
|
||||||
|
# uncomment if the backups are btrfs subvolumes
|
||||||
#btrfs = true
|
#btrfs = true
|
||||||
|
|
||||||
[[periods]]
|
[[periods]]
|
||||||
|
# For the first day, keep one backup per second (basically, don't delete backups)
|
||||||
|
# syntax supports suffixes s, m, h, d, w
|
||||||
|
period_length = "1d"
|
||||||
|
chunk_size = "1s"
|
||||||
|
|
||||||
|
[[periods]]
|
||||||
|
# For the next week, keep one backup per hour
|
||||||
period_length = "1w"
|
period_length = "1w"
|
||||||
chunk_size = "1h"
|
chunk_size = "1h"
|
||||||
|
|
||||||
[[periods]]
|
[[periods]]
|
||||||
|
# For the next 4 weeks, keep one backup per day
|
||||||
period_length = "4w"
|
period_length = "4w"
|
||||||
chunk_size = "1d"
|
chunk_size = "1d"
|
||||||
|
|
||||||
[[periods]]
|
# can add more [[periods]] as needed
|
||||||
period_length = "40w"
|
|
||||||
chunk_size = "4w"
|
|
||||||
|
|||||||
132
src/config.rs
132
src/config.rs
@ -1,8 +1,8 @@
|
|||||||
|
use chrono::Duration;
|
||||||
use serde::de::Visitor;
|
use serde::de::Visitor;
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{de::Error, Deserialize, Deserializer};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
@ -16,76 +16,100 @@ pub struct Config {
|
|||||||
pub periods: Vec<ConfPeriod>,
|
pub periods: Vec<ConfPeriod>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
|
||||||
pub struct ConfPeriod {
|
pub enum SimpleDuration {
|
||||||
/// The total duration of this period
|
Weeks(i64),
|
||||||
#[serde(deserialize_with = "parse_duration")]
|
Days(i64),
|
||||||
pub period_length: Duration,
|
Hours(i64),
|
||||||
|
Minutes(i64),
|
||||||
/// The size of chunks in this period. Each chunk should hold 1 file.
|
Seconds(i64),
|
||||||
#[serde(deserialize_with = "parse_duration")]
|
|
||||||
pub chunk_size: Duration,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_duration<'de, D>(d: D) -> Result<Duration, D::Error>
|
impl From<SimpleDuration> for Duration {
|
||||||
|
fn from(simple: SimpleDuration) -> Duration {
|
||||||
|
match simple {
|
||||||
|
SimpleDuration::Weeks(weeks) => Duration::weeks(weeks),
|
||||||
|
SimpleDuration::Days(days) => Duration::days(days),
|
||||||
|
SimpleDuration::Hours(hours) => Duration::hours(hours),
|
||||||
|
SimpleDuration::Minutes(minutes) => Duration::minutes(minutes),
|
||||||
|
SimpleDuration::Seconds(seconds) => Duration::seconds(seconds),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||||
|
pub struct ConfPeriod {
|
||||||
|
/// The total duration of this period
|
||||||
|
#[serde(deserialize_with = "parse_simple_duration")]
|
||||||
|
pub period_length: SimpleDuration,
|
||||||
|
|
||||||
|
/// The size of chunks in this period. Each chunk should hold 1 file.
|
||||||
|
#[serde(deserialize_with = "parse_simple_duration")]
|
||||||
|
pub chunk_size: SimpleDuration,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ConfPeriod {
|
||||||
|
pub fn chunk_count(&self) -> i64 {
|
||||||
|
let period_length: Duration = self.period_length.into();
|
||||||
|
let chunk_size: Duration = self.chunk_size.into();
|
||||||
|
period_length.num_milliseconds() / chunk_size.num_milliseconds()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Deserialize a [SimpleDuration] from a string like "3d" or "24h".
|
||||||
|
fn parse_simple_duration<'de, D>(d: D) -> Result<SimpleDuration, D::Error>
|
||||||
where
|
where
|
||||||
D: Deserializer<'de>,
|
D: Deserializer<'de>,
|
||||||
{
|
{
|
||||||
let s = d.deserialize_string(StringVisitor)?;
|
let s = d.deserialize_str(StrVisitor)?;
|
||||||
|
let s = s.trim();
|
||||||
|
|
||||||
let mut duration = Duration::ZERO;
|
if s.contains(char::is_whitespace) {
|
||||||
|
return Err(D::Error::custom("duration can't include whitespace"));
|
||||||
for part in s.split_whitespace() {
|
|
||||||
if part.len() < 2 {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let suffix = part.chars().rev().next().unwrap();
|
let suffix = s
|
||||||
let value = &part[..part.len() - suffix.len_utf8()];
|
.chars()
|
||||||
|
.next_back()
|
||||||
|
.ok_or_else(|| D::Error::custom("duration can't be empty"))?;
|
||||||
|
|
||||||
let value: u32 = value.parse().expect("failed to parse duration value");
|
if suffix.is_ascii_digit() {
|
||||||
|
return Err(D::Error::custom(
|
||||||
let second: Duration = Duration::from_secs(1);
|
r#"specify duration with a suffix, i.e. "24h""#,
|
||||||
let minute: Duration = second * 60;
|
));
|
||||||
let hour: Duration = minute * 60;
|
|
||||||
let day: Duration = hour * 24;
|
|
||||||
let week: Duration = day * 7;
|
|
||||||
let year: Duration = day * 365;
|
|
||||||
|
|
||||||
let unit = match suffix.to_ascii_lowercase() {
|
|
||||||
's' => second,
|
|
||||||
'm' => minute,
|
|
||||||
'h' => hour,
|
|
||||||
'd' => day,
|
|
||||||
'w' => week,
|
|
||||||
'y' => year,
|
|
||||||
_ => panic!("unknown unit of duration"),
|
|
||||||
};
|
|
||||||
|
|
||||||
duration += unit * value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if duration == Duration::ZERO {
|
let value = &s[..s.len() - suffix.len_utf8()];
|
||||||
panic!("Invalid duration: Zero");
|
|
||||||
|
let value: u64 = value
|
||||||
|
.parse()
|
||||||
|
.map_err(|e| D::Error::custom(format!("failed to parse duration value: {e}")))?;
|
||||||
|
let value = value as i64;
|
||||||
|
|
||||||
|
use SimpleDuration::*;
|
||||||
|
Ok(match suffix.to_ascii_lowercase() {
|
||||||
|
's' => Seconds(value),
|
||||||
|
'm' => Minutes(value),
|
||||||
|
'h' => Hours(value),
|
||||||
|
'd' => Days(value),
|
||||||
|
'w' => Weeks(value),
|
||||||
|
d => return Err(D::Error::custom(format!("unknown unit of duration: {d:?}"))),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(duration)
|
struct StrVisitor;
|
||||||
}
|
|
||||||
|
|
||||||
struct StringVisitor;
|
impl<'de> Visitor<'de> for StrVisitor {
|
||||||
|
type Value = &'de str;
|
||||||
impl<'de> Visitor<'de> for StringVisitor {
|
|
||||||
type Value = String;
|
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
formatter.write_str("a string")
|
formatter.write_str("a string")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_string<E>(self, value: String) -> Result<Self::Value, E> {
|
fn visit_borrowed_str<E>(self, s: &'de str) -> Result<Self::Value, E>
|
||||||
Ok(value)
|
where
|
||||||
}
|
E: Error,
|
||||||
|
{
|
||||||
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E> {
|
Ok(s)
|
||||||
Ok(value.to_string())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
480
src/main.rs
480
src/main.rs
@ -1,26 +1,29 @@
|
|||||||
|
//! CLI to delete dated files in a directory according to a time period config.
|
||||||
|
//! Useful for backup directories that accumulate files over time.
|
||||||
|
|
||||||
mod config;
|
mod config;
|
||||||
|
|
||||||
use chrono::{DateTime, FixedOffset, Local};
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
use clap::Parser;
|
use chrono::{DateTime, Duration, FixedOffset, Local};
|
||||||
use config::Config;
|
use clap::{ArgAction, Parser};
|
||||||
|
use config::{ConfPeriod, Config, SimpleDuration};
|
||||||
|
use eyre::{eyre, Context};
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use std::collections::{BinaryHeap, HashSet};
|
use std::collections::{BinaryHeap, HashMap, HashSet};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io;
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use thiserror::Error;
|
|
||||||
|
|
||||||
type FileName = DateTime<FixedOffset>;
|
type FileName = DateTime<FixedOffset>;
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
|
#[command(version)]
|
||||||
struct Opt {
|
struct Opt {
|
||||||
config: PathBuf,
|
config: PathBuf,
|
||||||
|
|
||||||
/// Log more stuff
|
/// Log more stuff
|
||||||
#[clap(long, short, parse(from_occurrences))]
|
#[clap(long, short, action = ArgAction::Count)]
|
||||||
verbose: u8,
|
verbose: u8,
|
||||||
|
|
||||||
/// Do not output anything but errors.
|
/// Do not output anything but errors.
|
||||||
@ -32,23 +35,9 @@ struct Opt {
|
|||||||
dry_run: bool,
|
dry_run: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
fn main() -> eyre::Result<()> {
|
||||||
enum Error {
|
|
||||||
#[error("I/O error: {0}")]
|
|
||||||
IO(#[from] io::Error),
|
|
||||||
|
|
||||||
#[error("Failed to parse config: {0}")]
|
|
||||||
ParseConfig(#[from] toml::de::Error),
|
|
||||||
|
|
||||||
#[error("Managed to overflow a DateTime. What did you do??")]
|
|
||||||
DateTimeOverflow,
|
|
||||||
|
|
||||||
#[error("Failed to delete btrfs subvolume: {0}")]
|
|
||||||
DeleteSubvolume(String),
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let opt = Opt::parse();
|
let opt = Opt::parse();
|
||||||
|
color_eyre::install()?;
|
||||||
|
|
||||||
let log_level = match opt.verbose {
|
let log_level = match opt.verbose {
|
||||||
0 if opt.quiet => LevelFilter::Error,
|
0 if opt.quiet => LevelFilter::Error,
|
||||||
@ -61,14 +50,15 @@ fn main() {
|
|||||||
.filter(None, log_level)
|
.filter(None, log_level)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
if let Err(e) = run(&opt) {
|
run(&opt)
|
||||||
println!("{e}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(opt: &Opt) -> Result<(), Error> {
|
fn run(opt: &Opt) -> eyre::Result<()> {
|
||||||
let config = fs::read_to_string(&opt.config)?;
|
let config = fs::read_to_string(&opt.config)
|
||||||
let config: Config = toml::from_str(&config)?;
|
.wrap_err_with(|| format!("Failed to read config file {:?}", opt.config))?;
|
||||||
|
|
||||||
|
let config: Config = toml::from_str(&config).wrap_err("Failed to parse config file")?;
|
||||||
|
|
||||||
debug!("periods:");
|
debug!("periods:");
|
||||||
for period in &config.periods {
|
for period in &config.periods {
|
||||||
debug!(
|
debug!(
|
||||||
@ -80,17 +70,23 @@ fn run(opt: &Opt) -> Result<(), Error> {
|
|||||||
info!("scanning directory {:?}", config.path);
|
info!("scanning directory {:?}", config.path);
|
||||||
|
|
||||||
let mut files = BinaryHeap::new();
|
let mut files = BinaryHeap::new();
|
||||||
for entry in fs::read_dir(&config.path)? {
|
|
||||||
let name = entry?.file_name();
|
let dir_err = || format!("Failed to read directory {:?}", config.path);
|
||||||
|
|
||||||
|
for entry in fs::read_dir(&config.path).wrap_err_with(dir_err)? {
|
||||||
|
let name = entry.wrap_err_with(dir_err)?.file_name();
|
||||||
let name = name.to_string_lossy();
|
let name = name.to_string_lossy();
|
||||||
if let Ok(time) = DateTime::parse_from_rfc3339(&name) {
|
if let Ok(time) = DateTime::parse_from_rfc3339(&name) {
|
||||||
trace!("found \"{name}\"");
|
trace!("found \"{name}\"");
|
||||||
files.push(time);
|
files.push(time);
|
||||||
|
} else {
|
||||||
|
trace!("ignoring \"{name}\", couldn't parse filename as rfc3339");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let files = files.into_sorted_vec();
|
let files = files.into_sorted_vec();
|
||||||
|
|
||||||
let keep_files = check_files_to_keep(&config, &files)?;
|
let now = Local::now();
|
||||||
|
let keep_files = check_files_to_keep(now, &config.periods, &files);
|
||||||
|
|
||||||
info!("final decision:");
|
info!("final decision:");
|
||||||
for &file in &files {
|
for &file in &files {
|
||||||
@ -111,77 +107,67 @@ fn run(opt: &Opt) -> Result<(), Error> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_files_to_keep(config: &Config, files: &[FileName]) -> Result<HashSet<FileName>, Error> {
|
fn check_files_to_keep(
|
||||||
|
now: DateTime<Local>,
|
||||||
|
periods: &[ConfPeriod],
|
||||||
|
files: &[FileName],
|
||||||
|
) -> HashSet<FileName> {
|
||||||
let mut files = files.to_vec();
|
let mut files = files.to_vec();
|
||||||
|
|
||||||
let mut keep_files = HashSet::new();
|
debug_assert_eq!(
|
||||||
|
files,
|
||||||
|
{
|
||||||
|
let mut sorted = files.clone();
|
||||||
|
sorted.sort();
|
||||||
|
sorted
|
||||||
|
},
|
||||||
|
"file list must be sorted"
|
||||||
|
);
|
||||||
|
|
||||||
|
let mut chunked_files = HashMap::new();
|
||||||
|
|
||||||
let now = Local::now();
|
|
||||||
let mut cursor = now;
|
let mut cursor = now;
|
||||||
|
|
||||||
for period in &config.periods {
|
'period: for period in periods {
|
||||||
if files.is_empty() {
|
let first_chunk = ChunkTime::of(period, cursor);
|
||||||
trace!("no more files, skipping remaining periods");
|
let start_index = first_chunk.index();
|
||||||
break;
|
let stop_index = start_index - period.chunk_count();
|
||||||
}
|
|
||||||
|
|
||||||
let period_length = chrono::Duration::from_std(period.period_length)
|
trace!("period {period:?}:");
|
||||||
.map_err(|_| Error::DateTimeOverflow)?;
|
trace!(" first chunk: {first_chunk:?}");
|
||||||
let chunk_size =
|
trace!(" index range: {start_index}..{stop_index}");
|
||||||
chrono::Duration::from_std(period.chunk_size).map_err(|_| Error::DateTimeOverflow)?;
|
|
||||||
|
|
||||||
if period_length < chunk_size {
|
'chunk: loop {
|
||||||
panic!("invalid period configuration");
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: we are looking backwards in time, so all checks and additions need to be inverted
|
|
||||||
let period_end = cursor - period_length;
|
|
||||||
|
|
||||||
while cursor > period_end {
|
|
||||||
if files.is_empty() {
|
|
||||||
trace!("no more files, skipping remaining chunks");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let start_of_chunk = cursor;
|
|
||||||
let end_of_chunk = cursor - chunk_size;
|
|
||||||
cursor = end_of_chunk;
|
|
||||||
|
|
||||||
let mut chunk_file_to_keep = None;
|
|
||||||
|
|
||||||
trace!("processing chunk {end_of_chunk} -> {start_of_chunk}");
|
|
||||||
loop {
|
|
||||||
let file = match files.pop() {
|
let file = match files.pop() {
|
||||||
Some(file) => file,
|
Some(file) => file,
|
||||||
None => break,
|
None => break 'period,
|
||||||
};
|
};
|
||||||
|
|
||||||
if file > start_of_chunk {
|
let file_chunk = ChunkTime::of(period, file.into());
|
||||||
trace!("{file} outside of chunk bounds. ignoring.");
|
|
||||||
keep_files.insert(file);
|
let index = file_chunk.index();
|
||||||
} else if file > end_of_chunk {
|
|
||||||
trace!("{file} is in chunk. beaten by {chunk_file_to_keep:?}");
|
trace!("{file}:");
|
||||||
chunk_file_to_keep.get_or_insert(file);
|
trace!(" comparing to period {period:?}");
|
||||||
} else {
|
trace!(" is in chunk {file_chunk:?}");
|
||||||
trace!("reached end of chunk");
|
trace!(" with index {index}");
|
||||||
files.push(file); // put the file back in the queue
|
|
||||||
break;
|
if index <= stop_index {
|
||||||
|
trace!(" not in this period, checking next");
|
||||||
|
files.push(file);
|
||||||
|
cursor = file.into();
|
||||||
|
break 'chunk;
|
||||||
|
}
|
||||||
|
|
||||||
|
trace!(" keeping for this period");
|
||||||
|
chunked_files.insert((period, file_chunk), file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(file) = chunk_file_to_keep {
|
chunked_files.values().copied().collect()
|
||||||
trace!("keeping files {file}");
|
|
||||||
keep_files.insert(file);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cursor = period_end;
|
fn delete_file(config: &Config, file: FileName) -> eyre::Result<()> {
|
||||||
}
|
|
||||||
|
|
||||||
Ok(keep_files)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn delete_file(config: &Config, file: FileName) -> Result<(), Error> {
|
|
||||||
let file_path = config.path.join(file.to_rfc3339());
|
let file_path = config.path.join(file.to_rfc3339());
|
||||||
|
|
||||||
if config.btrfs {
|
if config.btrfs {
|
||||||
@ -189,23 +175,327 @@ fn delete_file(config: &Config, file: FileName) -> Result<(), Error> {
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
let output = Command::new("btrfs")
|
let output = Command::new("btrfs")
|
||||||
.args(["subvolume", "delete"])
|
.args(["subvolume", "delete"])
|
||||||
.arg(file_path)
|
.arg(&file_path)
|
||||||
.output()?;
|
.output()
|
||||||
|
.wrap_err("failed to run 'btrfs subvolume delete'")?;
|
||||||
|
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
let msg = String::from_utf8(output.stderr)
|
let msg = String::from_utf8(output.stderr)
|
||||||
.unwrap_or_else(|_| "Failed to capture stderr".to_string());
|
.unwrap_or_else(|_| "Failed to capture stderr".to_string());
|
||||||
return Err(Error::DeleteSubvolume(msg));
|
|
||||||
|
return Err(
|
||||||
|
eyre!("btrfs subvolume delete exited with code {}", output.status)
|
||||||
|
.wrap_err(msg)
|
||||||
|
.wrap_err(format!("Failed to delete subvolume {file_path:?}")),
|
||||||
|
);
|
||||||
};
|
};
|
||||||
} else {
|
} else if file_path.is_dir() {
|
||||||
if file_path.is_dir() {
|
|
||||||
trace!("rm -r {file_path:?}");
|
trace!("rm -r {file_path:?}");
|
||||||
fs::remove_dir_all(file_path)?;
|
fs::remove_dir_all(&file_path)
|
||||||
|
.wrap_err_with(|| format!("Failed to remove directory {file_path:?}"))?;
|
||||||
} else {
|
} else {
|
||||||
trace!("rm {file_path:?}");
|
trace!("rm {file_path:?}");
|
||||||
fs::remove_file(file_path)?;
|
fs::remove_file(&file_path)
|
||||||
}
|
.wrap_err_with(|| format!("Failed to remove file {file_path:?}"))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const EPOCH_STR: &str = "1900-01-01T00:00:00+00:00";
|
||||||
|
fn epoch() -> DateTime<Local> {
|
||||||
|
DateTime::parse_from_rfc3339(EPOCH_STR)
|
||||||
|
.expect("Failed to parse epoch")
|
||||||
|
.into()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||||
|
pub struct ChunkTime {
|
||||||
|
/// The value of the time of the chunk, e.g. how many seconds
|
||||||
|
pub value: i64,
|
||||||
|
|
||||||
|
/// The time unit of the chunk, e.g. seconds
|
||||||
|
pub unit: fn(i64) -> Duration,
|
||||||
|
|
||||||
|
/// A number of whole [unit]s since the epoch
|
||||||
|
///
|
||||||
|
/// This value corresponds to a time within the chunk
|
||||||
|
pub since_epoch: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ChunkTime {
|
||||||
|
//pub fn next(self) -> ChunkTime {
|
||||||
|
// Self {
|
||||||
|
// since_epoch: self.since_epoch + self.value,
|
||||||
|
// ..self
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
pub fn index(&self) -> i64 {
|
||||||
|
self.since_epoch / self.value
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn start(&self) -> DateTime<Local> {
|
||||||
|
/// compute the largest multiple of `b`, that is smaller than `a`
|
||||||
|
fn last_mul_of(a: i64, b: i64) -> i64 {
|
||||||
|
a / b * b
|
||||||
|
}
|
||||||
|
|
||||||
|
epoch() + (self.unit)(last_mul_of(self.since_epoch, self.value))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn of(period: &ConfPeriod, time: DateTime<Local>) -> Self {
|
||||||
|
let since_epoch = time - epoch();
|
||||||
|
|
||||||
|
use SimpleDuration::*;
|
||||||
|
match period.chunk_size {
|
||||||
|
Seconds(s) => ChunkTime {
|
||||||
|
unit: Duration::seconds,
|
||||||
|
value: s,
|
||||||
|
since_epoch: since_epoch.num_seconds(),
|
||||||
|
},
|
||||||
|
Minutes(m) => ChunkTime {
|
||||||
|
unit: Duration::minutes,
|
||||||
|
value: m,
|
||||||
|
since_epoch: since_epoch.num_minutes(),
|
||||||
|
},
|
||||||
|
Hours(h) => ChunkTime {
|
||||||
|
unit: Duration::hours,
|
||||||
|
value: h,
|
||||||
|
since_epoch: since_epoch.num_hours(),
|
||||||
|
},
|
||||||
|
Days(d) => ChunkTime {
|
||||||
|
unit: Duration::days,
|
||||||
|
value: d,
|
||||||
|
since_epoch: since_epoch.num_days(),
|
||||||
|
},
|
||||||
|
Weeks(w) => ChunkTime {
|
||||||
|
unit: Duration::weeks,
|
||||||
|
value: w,
|
||||||
|
since_epoch: since_epoch.num_weeks(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use super::*;
|
||||||
|
use crate::config::{ConfPeriod, SimpleDuration};
|
||||||
|
use chrono::DateTime;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn chunk_of_period_hours() {
|
||||||
|
let period = ConfPeriod {
|
||||||
|
period_length: SimpleDuration::Weeks(1),
|
||||||
|
chunk_size: SimpleDuration::Hours(12),
|
||||||
|
};
|
||||||
|
|
||||||
|
let tests = [
|
||||||
|
(
|
||||||
|
"2020-01-01T12:00:00+00:00", // time
|
||||||
|
"2020-01-01T12:00:00+00:00", // expected chunk start
|
||||||
|
87659, // expected chunk index
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"2020-01-02T12:00:00+00:00",
|
||||||
|
"2020-01-02T12:00:00+00:00",
|
||||||
|
87661,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"2020-01-03T12:00:00+00:00",
|
||||||
|
"2020-01-03T12:00:00+00:00",
|
||||||
|
87663,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"2020-01-04T12:00:00+00:00",
|
||||||
|
"2020-01-04T12:00:00+00:00",
|
||||||
|
87665,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
for (time, expected_chunk_start, expected_chunk_index) in tests {
|
||||||
|
let time: DateTime<Local> = DateTime::parse_from_rfc3339(time).unwrap().into();
|
||||||
|
let expected_chunk_start = DateTime::parse_from_rfc3339(expected_chunk_start).unwrap();
|
||||||
|
|
||||||
|
let chunk = ChunkTime::of(&period, time);
|
||||||
|
|
||||||
|
assert_eq!(chunk.start(), expected_chunk_start);
|
||||||
|
assert_eq!(chunk.index(), expected_chunk_index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn chunk_of_period_days() {
|
||||||
|
let period = ConfPeriod {
|
||||||
|
period_length: SimpleDuration::Days(15),
|
||||||
|
chunk_size: SimpleDuration::Days(3),
|
||||||
|
};
|
||||||
|
|
||||||
|
let tests = [
|
||||||
|
(
|
||||||
|
"2020-01-01T12:00:00+00:00", // time
|
||||||
|
"2019-12-30T00:00:00+00:00", // expected chunk start
|
||||||
|
14609, // expected chunk index
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"2020-01-02T12:00:00+00:00",
|
||||||
|
"2020-01-02T00:00:00+00:00",
|
||||||
|
14610,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"2020-01-03T12:00:00+00:00",
|
||||||
|
"2020-01-02T00:00:00+00:00",
|
||||||
|
14610,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"2020-01-04T12:00:00+00:00",
|
||||||
|
"2020-01-02T00:00:00+00:00",
|
||||||
|
14610,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
for (time, expected_chunk_start, expected_chunk_index) in tests {
|
||||||
|
let time: DateTime<Local> = DateTime::parse_from_rfc3339(time).unwrap().into();
|
||||||
|
let expected_chunk_start = DateTime::parse_from_rfc3339(expected_chunk_start).unwrap();
|
||||||
|
|
||||||
|
let chunk = ChunkTime::of(&period, time);
|
||||||
|
|
||||||
|
assert_eq!(chunk.start(), expected_chunk_start);
|
||||||
|
assert_eq!(chunk.index(), expected_chunk_index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn delete_files() {
|
||||||
|
use SimpleDuration::*;
|
||||||
|
|
||||||
|
let periods = [
|
||||||
|
ConfPeriod {
|
||||||
|
period_length: Hours(6),
|
||||||
|
chunk_size: Seconds(1),
|
||||||
|
},
|
||||||
|
ConfPeriod {
|
||||||
|
period_length: Hours(6),
|
||||||
|
chunk_size: Hours(1),
|
||||||
|
},
|
||||||
|
ConfPeriod {
|
||||||
|
period_length: Days(8),
|
||||||
|
chunk_size: Days(2),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
let input = [
|
||||||
|
"2020-01-01T01:00:00+00:00",
|
||||||
|
"2020-01-01T02:00:00+00:00",
|
||||||
|
"2020-01-01T03:00:00+00:00",
|
||||||
|
"2020-01-01T04:00:00+00:00",
|
||||||
|
"2020-01-01T05:00:00+00:00",
|
||||||
|
"2020-01-01T06:00:00+00:00",
|
||||||
|
"2020-01-01T07:00:00+00:00",
|
||||||
|
"2020-01-01T08:00:00+00:00",
|
||||||
|
"2020-01-01T09:00:00+00:00",
|
||||||
|
"2020-01-01T10:00:00+00:00",
|
||||||
|
"2020-01-01T10:00:32+00:00",
|
||||||
|
"2020-01-01T10:00:33+00:00",
|
||||||
|
"2020-01-01T10:00:34+00:00",
|
||||||
|
"2020-01-01T11:00:00+00:00",
|
||||||
|
"2020-01-01T12:00:00+00:00",
|
||||||
|
"2020-01-01T13:00:00+00:00",
|
||||||
|
"2020-01-01T14:00:00+00:00",
|
||||||
|
"2020-01-01T15:00:00+00:00",
|
||||||
|
"2020-01-01T16:00:00+00:00",
|
||||||
|
"2020-01-01T17:00:00+00:00",
|
||||||
|
"2020-01-01T18:00:00+00:00",
|
||||||
|
"2020-01-01T19:00:00+00:00",
|
||||||
|
"2020-01-01T20:00:00+00:00",
|
||||||
|
"2020-01-01T21:00:00+00:00",
|
||||||
|
"2020-01-01T22:00:00+00:00",
|
||||||
|
"2020-01-01T23:00:00+00:00",
|
||||||
|
"2020-01-02T00:00:00+00:00",
|
||||||
|
"2020-01-02T01:00:00+00:00",
|
||||||
|
"2020-01-02T02:00:00+00:00",
|
||||||
|
"2020-01-02T03:00:00+00:00",
|
||||||
|
"2020-01-02T04:00:00+00:00",
|
||||||
|
"2020-01-02T05:00:00+00:00",
|
||||||
|
"2020-01-02T06:00:00+00:00",
|
||||||
|
"2020-01-02T07:00:00+00:00",
|
||||||
|
"2020-01-02T08:00:00+00:00",
|
||||||
|
"2020-01-02T09:00:00+00:00",
|
||||||
|
"2020-01-02T10:00:00+00:00",
|
||||||
|
"2020-01-02T11:00:00+00:00",
|
||||||
|
"2020-01-02T12:00:00+00:00",
|
||||||
|
"2020-01-02T13:00:00+00:00",
|
||||||
|
"2020-01-02T14:00:00+00:00",
|
||||||
|
"2020-01-02T15:00:00+00:00",
|
||||||
|
"2020-01-02T16:00:00+00:00",
|
||||||
|
"2020-01-02T17:00:00+00:00",
|
||||||
|
"2020-01-02T18:00:00+00:00",
|
||||||
|
"2020-01-02T19:00:00+00:00",
|
||||||
|
"2020-01-02T20:00:00+00:00",
|
||||||
|
"2020-01-02T21:00:00+00:00",
|
||||||
|
"2020-01-02T22:00:00+00:00",
|
||||||
|
"2020-01-02T23:00:00+00:00",
|
||||||
|
"2020-01-03T00:00:00+00:00",
|
||||||
|
"2020-01-03T01:00:00+00:00",
|
||||||
|
"2020-01-03T02:00:00+00:00",
|
||||||
|
"2020-01-03T03:00:00+00:00",
|
||||||
|
"2020-01-03T04:00:00+00:00",
|
||||||
|
"2020-01-03T05:00:00+00:00",
|
||||||
|
"2020-01-03T06:00:00+00:00",
|
||||||
|
"2020-01-03T07:00:00+00:00",
|
||||||
|
"2020-01-03T08:00:00+00:00",
|
||||||
|
"2020-01-03T09:00:00+00:00",
|
||||||
|
"2020-01-03T10:00:00+00:00",
|
||||||
|
"2020-01-03T11:00:00+00:00",
|
||||||
|
"2020-01-03T12:00:00+00:00",
|
||||||
|
"2020-01-03T13:00:00+00:00",
|
||||||
|
"2020-01-03T14:00:00+00:00",
|
||||||
|
"2020-01-03T14:00:10+00:00",
|
||||||
|
"2020-01-03T14:00:20+00:00",
|
||||||
|
"2020-01-03T15:00:00+00:00",
|
||||||
|
"2020-01-03T16:00:00+00:00",
|
||||||
|
"2020-01-03T17:00:00+00:00",
|
||||||
|
"2020-01-03T18:00:00+00:00",
|
||||||
|
"2020-01-03T19:00:00+00:00",
|
||||||
|
"2020-01-03T20:00:00+00:00",
|
||||||
|
"2020-01-03T21:00:00+00:00",
|
||||||
|
"2020-01-03T22:00:30+00:00",
|
||||||
|
"2020-01-03T22:00:31+00:00",
|
||||||
|
"2020-01-03T22:00:32+00:00",
|
||||||
|
"2020-01-03T22:00:33+00:00",
|
||||||
|
"2020-01-03T23:00:00+00:00",
|
||||||
|
];
|
||||||
|
let input = input.map(|date| DateTime::parse_from_rfc3339(date).unwrap());
|
||||||
|
|
||||||
|
let expected_output = [
|
||||||
|
"2020-01-01T01:00:00+00:00",
|
||||||
|
"2020-01-02T00:00:00+00:00",
|
||||||
|
"2020-01-03T00:00:00+00:00",
|
||||||
|
"2020-01-03T13:00:00+00:00",
|
||||||
|
"2020-01-03T14:00:00+00:00",
|
||||||
|
"2020-01-03T15:00:00+00:00",
|
||||||
|
"2020-01-03T16:00:00+00:00",
|
||||||
|
"2020-01-03T17:00:00+00:00",
|
||||||
|
"2020-01-03T18:00:00+00:00",
|
||||||
|
"2020-01-03T19:00:00+00:00",
|
||||||
|
"2020-01-03T20:00:00+00:00",
|
||||||
|
"2020-01-03T21:00:00+00:00",
|
||||||
|
"2020-01-03T22:00:30+00:00",
|
||||||
|
"2020-01-03T22:00:31+00:00",
|
||||||
|
"2020-01-03T22:00:32+00:00",
|
||||||
|
"2020-01-03T22:00:33+00:00",
|
||||||
|
"2020-01-03T23:00:00+00:00",
|
||||||
|
];
|
||||||
|
let expected_output: HashSet<_> = expected_output
|
||||||
|
.into_iter()
|
||||||
|
.map(|date| DateTime::parse_from_rfc3339(date).unwrap())
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
let start_time = DateTime::parse_from_rfc3339("2020-01-04T00:00:00+00:00").unwrap();
|
||||||
|
|
||||||
|
let output = check_files_to_keep(start_time.into(), &periods, &input).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(output, expected_output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user