summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock958
-rw-r--r--Cargo.toml38
-rw-r--r--assets/icon.pngbin0 -> 34190 bytes
-rw-r--r--src/backup.rs37
-rw-r--r--src/cli.rs7
-rw-r--r--src/config.rs28
-rw-r--r--src/error.rs17
-rw-r--r--src/main.rs47
-rw-r--r--src/packages.rs13
-rw-r--r--src/pathinfo.rs110
10 files changed, 992 insertions, 263 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fd46c42..fc3874e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3,21 +3,6 @@
3version = 3 3version = 3
4 4
5[[package]] 5[[package]]
6name = "addr2line"
7version = "0.21.0"
8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
10dependencies = [
11 "gimli",
12]
13
14[[package]]
15name = "adler"
16version = "1.0.2"
17source = "registry+https://github.com/rust-lang/crates.io-index"
18checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
19
20[[package]]
21name = "aho-corasick" 6name = "aho-corasick"
22version = "1.1.3" 7version = "1.1.3"
23source = "registry+https://github.com/rust-lang/crates.io-index" 8source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -80,10 +65,10 @@ name = "arbs"
80version = "0.1.0" 65version = "0.1.0"
81dependencies = [ 66dependencies = [
82 "clap", 67 "clap",
83 "color-eyre",
84 "config", 68 "config",
85 "dirs", 69 "dirs",
86 "gethostname", 70 "gethostname",
71 "notify-rust",
87 "serde", 72 "serde",
88 "serde_json", 73 "serde_json",
89 "thiserror", 74 "thiserror",
@@ -95,10 +80,107 @@ dependencies = [
95] 80]
96 81
97[[package]] 82[[package]]
98name = "async-trait" 83name = "async-broadcast"
99version = "0.1.82" 84version = "0.7.1"
85source = "registry+https://github.com/rust-lang/crates.io-index"
86checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e"
87dependencies = [
88 "event-listener",
89 "event-listener-strategy",
90 "futures-core",
91 "pin-project-lite",
92]
93
94[[package]]
95name = "async-channel"
96version = "2.3.1"
97source = "registry+https://github.com/rust-lang/crates.io-index"
98checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a"
99dependencies = [
100 "concurrent-queue",
101 "event-listener-strategy",
102 "futures-core",
103 "pin-project-lite",
104]
105
106[[package]]
107name = "async-executor"
108version = "1.13.1"
100source = "registry+https://github.com/rust-lang/crates.io-index" 109source = "registry+https://github.com/rust-lang/crates.io-index"
101checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" 110checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec"
111dependencies = [
112 "async-task",
113 "concurrent-queue",
114 "fastrand",
115 "futures-lite",
116 "slab",
117]
118
119[[package]]
120name = "async-fs"
121version = "2.1.2"
122source = "registry+https://github.com/rust-lang/crates.io-index"
123checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a"
124dependencies = [
125 "async-lock",
126 "blocking",
127 "futures-lite",
128]
129
130[[package]]
131name = "async-io"
132version = "2.3.4"
133source = "registry+https://github.com/rust-lang/crates.io-index"
134checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8"
135dependencies = [
136 "async-lock",
137 "cfg-if",
138 "concurrent-queue",
139 "futures-io",
140 "futures-lite",
141 "parking",
142 "polling",
143 "rustix",
144 "slab",
145 "tracing",
146 "windows-sys 0.59.0",
147]
148
149[[package]]
150name = "async-lock"
151version = "3.4.0"
152source = "registry+https://github.com/rust-lang/crates.io-index"
153checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"
154dependencies = [
155 "event-listener",
156 "event-listener-strategy",
157 "pin-project-lite",
158]
159
160[[package]]
161name = "async-process"
162version = "2.3.0"
163source = "registry+https://github.com/rust-lang/crates.io-index"
164checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb"
165dependencies = [
166 "async-channel",
167 "async-io",
168 "async-lock",
169 "async-signal",
170 "async-task",
171 "blocking",
172 "cfg-if",
173 "event-listener",
174 "futures-lite",
175 "rustix",
176 "tracing",
177]
178
179[[package]]
180name = "async-recursion"
181version = "1.1.1"
182source = "registry+https://github.com/rust-lang/crates.io-index"
183checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
102dependencies = [ 184dependencies = [
103 "proc-macro2", 185 "proc-macro2",
104 "quote", 186 "quote",
@@ -106,21 +188,53 @@ dependencies = [
106] 188]
107 189
108[[package]] 190[[package]]
109name = "backtrace" 191name = "async-signal"
110version = "0.3.71" 192version = "0.2.10"
111source = "registry+https://github.com/rust-lang/crates.io-index" 193source = "registry+https://github.com/rust-lang/crates.io-index"
112checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" 194checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3"
113dependencies = [ 195dependencies = [
114 "addr2line", 196 "async-io",
115 "cc", 197 "async-lock",
198 "atomic-waker",
116 "cfg-if", 199 "cfg-if",
117 "libc", 200 "futures-core",
118 "miniz_oxide", 201 "futures-io",
119 "object", 202 "rustix",
120 "rustc-demangle", 203 "signal-hook-registry",
204 "slab",
205 "windows-sys 0.59.0",
206]
207
208[[package]]
209name = "async-task"
210version = "4.7.1"
211source = "registry+https://github.com/rust-lang/crates.io-index"
212checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
213
214[[package]]
215name = "async-trait"
216version = "0.1.83"
217source = "registry+https://github.com/rust-lang/crates.io-index"
218checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
219dependencies = [
220 "proc-macro2",
221 "quote",
222 "syn",
121] 223]
122 224
123[[package]] 225[[package]]
226name = "atomic-waker"
227version = "1.1.2"
228source = "registry+https://github.com/rust-lang/crates.io-index"
229checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
230
231[[package]]
232name = "autocfg"
233version = "1.3.0"
234source = "registry+https://github.com/rust-lang/crates.io-index"
235checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
236
237[[package]]
124name = "base64" 238name = "base64"
125version = "0.21.7" 239version = "0.21.7"
126source = "registry+https://github.com/rust-lang/crates.io-index" 240source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -136,6 +250,12 @@ dependencies = [
136] 250]
137 251
138[[package]] 252[[package]]
253name = "block"
254version = "0.1.6"
255source = "registry+https://github.com/rust-lang/crates.io-index"
256checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
257
258[[package]]
139name = "block-buffer" 259name = "block-buffer"
140version = "0.10.4" 260version = "0.10.4"
141source = "registry+https://github.com/rust-lang/crates.io-index" 261source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -145,10 +265,29 @@ dependencies = [
145] 265]
146 266
147[[package]] 267[[package]]
268name = "blocking"
269version = "1.6.1"
270source = "registry+https://github.com/rust-lang/crates.io-index"
271checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea"
272dependencies = [
273 "async-channel",
274 "async-task",
275 "futures-io",
276 "futures-lite",
277 "piper",
278]
279
280[[package]]
281name = "byteorder"
282version = "1.5.0"
283source = "registry+https://github.com/rust-lang/crates.io-index"
284checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
285
286[[package]]
148name = "cc" 287name = "cc"
149version = "1.1.16" 288version = "1.1.21"
150source = "registry+https://github.com/rust-lang/crates.io-index" 289source = "registry+https://github.com/rust-lang/crates.io-index"
151checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" 290checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0"
152dependencies = [ 291dependencies = [
153 "shlex", 292 "shlex",
154] 293]
@@ -160,10 +299,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
160checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 299checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
161 300
162[[package]] 301[[package]]
302name = "cfg_aliases"
303version = "0.2.1"
304source = "registry+https://github.com/rust-lang/crates.io-index"
305checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
306
307[[package]]
163name = "clap" 308name = "clap"
164version = "4.5.17" 309version = "4.5.18"
165source = "registry+https://github.com/rust-lang/crates.io-index" 310source = "registry+https://github.com/rust-lang/crates.io-index"
166checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" 311checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3"
167dependencies = [ 312dependencies = [
168 "clap_builder", 313 "clap_builder",
169 "clap_derive", 314 "clap_derive",
@@ -171,9 +316,9 @@ dependencies = [
171 316
172[[package]] 317[[package]]
173name = "clap_builder" 318name = "clap_builder"
174version = "4.5.17" 319version = "4.5.18"
175source = "registry+https://github.com/rust-lang/crates.io-index" 320source = "registry+https://github.com/rust-lang/crates.io-index"
176checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" 321checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b"
177dependencies = [ 322dependencies = [
178 "anstream", 323 "anstream",
179 "anstyle", 324 "anstyle",
@@ -183,9 +328,9 @@ dependencies = [
183 328
184[[package]] 329[[package]]
185name = "clap_derive" 330name = "clap_derive"
186version = "4.5.13" 331version = "4.5.18"
187source = "registry+https://github.com/rust-lang/crates.io-index" 332source = "registry+https://github.com/rust-lang/crates.io-index"
188checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" 333checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
189dependencies = [ 334dependencies = [
190 "heck", 335 "heck",
191 "proc-macro2", 336 "proc-macro2",
@@ -200,39 +345,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
200checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" 345checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
201 346
202[[package]] 347[[package]]
203name = "color-eyre" 348name = "colorchoice"
204version = "0.6.3" 349version = "1.0.2"
205source = "registry+https://github.com/rust-lang/crates.io-index" 350source = "registry+https://github.com/rust-lang/crates.io-index"
206checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" 351checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
207dependencies = [
208 "backtrace",
209 "color-spantrace",
210 "eyre",
211 "indenter",
212 "once_cell",
213 "owo-colors",
214 "tracing-error",
215]
216 352
217[[package]] 353[[package]]
218name = "color-spantrace" 354name = "concurrent-queue"
219version = "0.2.1" 355version = "2.5.0"
220source = "registry+https://github.com/rust-lang/crates.io-index" 356source = "registry+https://github.com/rust-lang/crates.io-index"
221checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" 357checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
222dependencies = [ 358dependencies = [
223 "once_cell", 359 "crossbeam-utils",
224 "owo-colors",
225 "tracing-core",
226 "tracing-error",
227] 360]
228 361
229[[package]] 362[[package]]
230name = "colorchoice"
231version = "1.0.2"
232source = "registry+https://github.com/rust-lang/crates.io-index"
233checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
234
235[[package]]
236name = "config" 363name = "config"
237version = "0.14.0" 364version = "0.14.0"
238source = "registry+https://github.com/rust-lang/crates.io-index" 365source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -249,6 +376,7 @@ dependencies = [
249 "serde", 376 "serde",
250 "serde_json", 377 "serde_json",
251 "toml", 378 "toml",
379 "yaml-rust",
252] 380]
253 381
254[[package]] 382[[package]]
@@ -282,9 +410,9 @@ dependencies = [
282 410
283[[package]] 411[[package]]
284name = "cpufeatures" 412name = "cpufeatures"
285version = "0.2.13" 413version = "0.2.14"
286source = "registry+https://github.com/rust-lang/crates.io-index" 414source = "registry+https://github.com/rust-lang/crates.io-index"
287checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" 415checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0"
288dependencies = [ 416dependencies = [
289 "libc", 417 "libc",
290] 418]
@@ -349,6 +477,16 @@ dependencies = [
349] 477]
350 478
351[[package]] 479[[package]]
480name = "dirs-next"
481version = "2.0.0"
482source = "registry+https://github.com/rust-lang/crates.io-index"
483checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
484dependencies = [
485 "cfg-if",
486 "dirs-sys-next",
487]
488
489[[package]]
352name = "dirs-sys" 490name = "dirs-sys"
353version = "0.4.1" 491version = "0.4.1"
354source = "registry+https://github.com/rust-lang/crates.io-index" 492source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -361,6 +499,17 @@ dependencies = [
361] 499]
362 500
363[[package]] 501[[package]]
502name = "dirs-sys-next"
503version = "0.1.2"
504source = "registry+https://github.com/rust-lang/crates.io-index"
505checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
506dependencies = [
507 "libc",
508 "redox_users",
509 "winapi",
510]
511
512[[package]]
364name = "dlv-list" 513name = "dlv-list"
365version = "0.5.2" 514version = "0.5.2"
366source = "registry+https://github.com/rust-lang/crates.io-index" 515source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -370,6 +519,33 @@ dependencies = [
370] 519]
371 520
372[[package]] 521[[package]]
522name = "endi"
523version = "1.1.0"
524source = "registry+https://github.com/rust-lang/crates.io-index"
525checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf"
526
527[[package]]
528name = "enumflags2"
529version = "0.7.10"
530source = "registry+https://github.com/rust-lang/crates.io-index"
531checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d"
532dependencies = [
533 "enumflags2_derive",
534 "serde",
535]
536
537[[package]]
538name = "enumflags2_derive"
539version = "0.7.10"
540source = "registry+https://github.com/rust-lang/crates.io-index"
541checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8"
542dependencies = [
543 "proc-macro2",
544 "quote",
545 "syn",
546]
547
548[[package]]
373name = "equivalent" 549name = "equivalent"
374version = "1.0.1" 550version = "1.0.1"
375source = "registry+https://github.com/rust-lang/crates.io-index" 551source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -386,13 +562,83 @@ dependencies = [
386] 562]
387 563
388[[package]] 564[[package]]
389name = "eyre" 565name = "event-listener"
390version = "0.6.12" 566version = "5.3.1"
391source = "registry+https://github.com/rust-lang/crates.io-index" 567source = "registry+https://github.com/rust-lang/crates.io-index"
392checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" 568checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba"
393dependencies = [ 569dependencies = [
394 "indenter", 570 "concurrent-queue",
395 "once_cell", 571 "parking",
572 "pin-project-lite",
573]
574
575[[package]]
576name = "event-listener-strategy"
577version = "0.5.2"
578source = "registry+https://github.com/rust-lang/crates.io-index"
579checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1"
580dependencies = [
581 "event-listener",
582 "pin-project-lite",
583]
584
585[[package]]
586name = "fastrand"
587version = "2.1.1"
588source = "registry+https://github.com/rust-lang/crates.io-index"
589checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
590
591[[package]]
592name = "futures-core"
593version = "0.3.30"
594source = "registry+https://github.com/rust-lang/crates.io-index"
595checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
596
597[[package]]
598name = "futures-io"
599version = "0.3.30"
600source = "registry+https://github.com/rust-lang/crates.io-index"
601checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
602
603[[package]]
604name = "futures-lite"
605version = "2.3.0"
606source = "registry+https://github.com/rust-lang/crates.io-index"
607checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
608dependencies = [
609 "fastrand",
610 "futures-core",
611 "futures-io",
612 "parking",
613 "pin-project-lite",
614]
615
616[[package]]
617name = "futures-sink"
618version = "0.3.30"
619source = "registry+https://github.com/rust-lang/crates.io-index"
620checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
621
622[[package]]
623name = "futures-task"
624version = "0.3.30"
625source = "registry+https://github.com/rust-lang/crates.io-index"
626checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
627
628[[package]]
629name = "futures-util"
630version = "0.3.30"
631source = "registry+https://github.com/rust-lang/crates.io-index"
632checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
633dependencies = [
634 "futures-core",
635 "futures-io",
636 "futures-sink",
637 "futures-task",
638 "memchr",
639 "pin-project-lite",
640 "pin-utils",
641 "slab",
396] 642]
397 643
398[[package]] 644[[package]]
@@ -427,12 +673,6 @@ dependencies = [
427] 673]
428 674
429[[package]] 675[[package]]
430name = "gimli"
431version = "0.28.1"
432source = "registry+https://github.com/rust-lang/crates.io-index"
433checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
434
435[[package]]
436name = "hashbrown" 676name = "hashbrown"
437version = "0.13.2" 677version = "0.13.2"
438source = "registry+https://github.com/rust-lang/crates.io-index" 678source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -451,10 +691,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
451checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 691checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
452 692
453[[package]] 693[[package]]
454name = "indenter" 694name = "hermit-abi"
455version = "0.3.3" 695version = "0.4.0"
456source = "registry+https://github.com/rust-lang/crates.io-index" 696source = "registry+https://github.com/rust-lang/crates.io-index"
457checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" 697checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc"
698
699[[package]]
700name = "hex"
701version = "0.4.3"
702source = "registry+https://github.com/rust-lang/crates.io-index"
703checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
458 704
459[[package]] 705[[package]]
460name = "indexmap" 706name = "indexmap"
@@ -497,9 +743,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
497 743
498[[package]] 744[[package]]
499name = "libc" 745name = "libc"
500version = "0.2.158" 746version = "0.2.159"
501source = "registry+https://github.com/rust-lang/crates.io-index" 747source = "registry+https://github.com/rust-lang/crates.io-index"
502checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" 748checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
503 749
504[[package]] 750[[package]]
505name = "libredox" 751name = "libredox"
@@ -512,6 +758,12 @@ dependencies = [
512] 758]
513 759
514[[package]] 760[[package]]
761name = "linked-hash-map"
762version = "0.5.6"
763source = "registry+https://github.com/rust-lang/crates.io-index"
764checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
765
766[[package]]
515name = "linux-raw-sys" 767name = "linux-raw-sys"
516version = "0.4.14" 768version = "0.4.14"
517source = "registry+https://github.com/rust-lang/crates.io-index" 769source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -524,6 +776,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
524checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 776checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
525 777
526[[package]] 778[[package]]
779name = "mac-notification-sys"
780version = "0.6.2"
781source = "registry+https://github.com/rust-lang/crates.io-index"
782checksum = "dce8f34f3717aa37177e723df6c1fc5fb02b2a1087374ea3fe0ea42316dc8f91"
783dependencies = [
784 "cc",
785 "dirs-next",
786 "objc-foundation",
787 "objc_id",
788 "time",
789]
790
791[[package]]
792name = "malloc_buf"
793version = "0.0.6"
794source = "registry+https://github.com/rust-lang/crates.io-index"
795checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
796dependencies = [
797 "libc",
798]
799
800[[package]]
527name = "matchers" 801name = "matchers"
528version = "0.1.0" 802version = "0.1.0"
529source = "registry+https://github.com/rust-lang/crates.io-index" 803source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -539,18 +813,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
539checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 813checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
540 814
541[[package]] 815[[package]]
816name = "memoffset"
817version = "0.9.1"
818source = "registry+https://github.com/rust-lang/crates.io-index"
819checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
820dependencies = [
821 "autocfg",
822]
823
824[[package]]
542name = "minimal-lexical" 825name = "minimal-lexical"
543version = "0.2.1" 826version = "0.2.1"
544source = "registry+https://github.com/rust-lang/crates.io-index" 827source = "registry+https://github.com/rust-lang/crates.io-index"
545checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 828checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
546 829
547[[package]] 830[[package]]
548name = "miniz_oxide" 831name = "nix"
549version = "0.7.4" 832version = "0.29.0"
550source = "registry+https://github.com/rust-lang/crates.io-index" 833source = "registry+https://github.com/rust-lang/crates.io-index"
551checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" 834checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
552dependencies = [ 835dependencies = [
553 "adler", 836 "bitflags",
837 "cfg-if",
838 "cfg_aliases",
839 "libc",
840 "memoffset",
554] 841]
555 842
556[[package]] 843[[package]]
@@ -564,6 +851,19 @@ dependencies = [
564] 851]
565 852
566[[package]] 853[[package]]
854name = "notify-rust"
855version = "4.11.3"
856source = "registry+https://github.com/rust-lang/crates.io-index"
857checksum = "5134a72dc570b178bff81b01e81ab14a6fcc015391ed4b3b14853090658cd3a3"
858dependencies = [
859 "log",
860 "mac-notification-sys",
861 "serde",
862 "tauri-winrt-notification",
863 "zbus",
864]
865
866[[package]]
567name = "nu-ansi-term" 867name = "nu-ansi-term"
568version = "0.46.0" 868version = "0.46.0"
569source = "registry+https://github.com/rust-lang/crates.io-index" 869source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -580,12 +880,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
580checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 880checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
581 881
582[[package]] 882[[package]]
583name = "object" 883name = "objc"
584version = "0.32.2" 884version = "0.2.7"
585source = "registry+https://github.com/rust-lang/crates.io-index" 885source = "registry+https://github.com/rust-lang/crates.io-index"
586checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" 886checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
587dependencies = [ 887dependencies = [
588 "memchr", 888 "malloc_buf",
889]
890
891[[package]]
892name = "objc-foundation"
893version = "0.1.1"
894source = "registry+https://github.com/rust-lang/crates.io-index"
895checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
896dependencies = [
897 "block",
898 "objc",
899 "objc_id",
900]
901
902[[package]]
903name = "objc_id"
904version = "0.1.1"
905source = "registry+https://github.com/rust-lang/crates.io-index"
906checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"
907dependencies = [
908 "objc",
589] 909]
590 910
591[[package]] 911[[package]]
@@ -611,16 +931,26 @@ dependencies = [
611] 931]
612 932
613[[package]] 933[[package]]
934name = "ordered-stream"
935version = "0.2.0"
936source = "registry+https://github.com/rust-lang/crates.io-index"
937checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
938dependencies = [
939 "futures-core",
940 "pin-project-lite",
941]
942
943[[package]]
614name = "overload" 944name = "overload"
615version = "0.1.1" 945version = "0.1.1"
616source = "registry+https://github.com/rust-lang/crates.io-index" 946source = "registry+https://github.com/rust-lang/crates.io-index"
617checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 947checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
618 948
619[[package]] 949[[package]]
620name = "owo-colors" 950name = "parking"
621version = "3.5.0" 951version = "2.2.1"
622source = "registry+https://github.com/rust-lang/crates.io-index" 952source = "registry+https://github.com/rust-lang/crates.io-index"
623checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" 953checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
624 954
625[[package]] 955[[package]]
626name = "pathdiff" 956name = "pathdiff"
@@ -630,9 +960,9 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
630 960
631[[package]] 961[[package]]
632name = "pest" 962name = "pest"
633version = "2.7.11" 963version = "2.7.13"
634source = "registry+https://github.com/rust-lang/crates.io-index" 964source = "registry+https://github.com/rust-lang/crates.io-index"
635checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" 965checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9"
636dependencies = [ 966dependencies = [
637 "memchr", 967 "memchr",
638 "thiserror", 968 "thiserror",
@@ -641,9 +971,9 @@ dependencies = [
641 971
642[[package]] 972[[package]]
643name = "pest_derive" 973name = "pest_derive"
644version = "2.7.11" 974version = "2.7.13"
645source = "registry+https://github.com/rust-lang/crates.io-index" 975source = "registry+https://github.com/rust-lang/crates.io-index"
646checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" 976checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0"
647dependencies = [ 977dependencies = [
648 "pest", 978 "pest",
649 "pest_generator", 979 "pest_generator",
@@ -651,9 +981,9 @@ dependencies = [
651 981
652[[package]] 982[[package]]
653name = "pest_generator" 983name = "pest_generator"
654version = "2.7.11" 984version = "2.7.13"
655source = "registry+https://github.com/rust-lang/crates.io-index" 985source = "registry+https://github.com/rust-lang/crates.io-index"
656checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" 986checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e"
657dependencies = [ 987dependencies = [
658 "pest", 988 "pest",
659 "pest_meta", 989 "pest_meta",
@@ -664,9 +994,9 @@ dependencies = [
664 994
665[[package]] 995[[package]]
666name = "pest_meta" 996name = "pest_meta"
667version = "2.7.11" 997version = "2.7.13"
668source = "registry+https://github.com/rust-lang/crates.io-index" 998source = "registry+https://github.com/rust-lang/crates.io-index"
669checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" 999checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f"
670dependencies = [ 1000dependencies = [
671 "once_cell", 1001 "once_cell",
672 "pest", 1002 "pest",
@@ -680,12 +1010,62 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
680checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 1010checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
681 1011
682[[package]] 1012[[package]]
1013name = "pin-utils"
1014version = "0.1.0"
1015source = "registry+https://github.com/rust-lang/crates.io-index"
1016checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1017
1018[[package]]
1019name = "piper"
1020version = "0.2.4"
1021source = "registry+https://github.com/rust-lang/crates.io-index"
1022checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
1023dependencies = [
1024 "atomic-waker",
1025 "fastrand",
1026 "futures-io",
1027]
1028
1029[[package]]
1030name = "polling"
1031version = "3.7.3"
1032source = "registry+https://github.com/rust-lang/crates.io-index"
1033checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511"
1034dependencies = [
1035 "cfg-if",
1036 "concurrent-queue",
1037 "hermit-abi",
1038 "pin-project-lite",
1039 "rustix",
1040 "tracing",
1041 "windows-sys 0.59.0",
1042]
1043
1044[[package]]
683name = "powerfmt" 1045name = "powerfmt"
684version = "0.2.0" 1046version = "0.2.0"
685source = "registry+https://github.com/rust-lang/crates.io-index" 1047source = "registry+https://github.com/rust-lang/crates.io-index"
686checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1048checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
687 1049
688[[package]] 1050[[package]]
1051name = "ppv-lite86"
1052version = "0.2.20"
1053source = "registry+https://github.com/rust-lang/crates.io-index"
1054checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
1055dependencies = [
1056 "zerocopy",
1057]
1058
1059[[package]]
1060name = "proc-macro-crate"
1061version = "3.2.0"
1062source = "registry+https://github.com/rust-lang/crates.io-index"
1063checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b"
1064dependencies = [
1065 "toml_edit",
1066]
1067
1068[[package]]
689name = "proc-macro2" 1069name = "proc-macro2"
690version = "1.0.86" 1070version = "1.0.86"
691source = "registry+https://github.com/rust-lang/crates.io-index" 1071source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -695,6 +1075,15 @@ dependencies = [
695] 1075]
696 1076
697[[package]] 1077[[package]]
1078name = "quick-xml"
1079version = "0.31.0"
1080source = "registry+https://github.com/rust-lang/crates.io-index"
1081checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33"
1082dependencies = [
1083 "memchr",
1084]
1085
1086[[package]]
698name = "quote" 1087name = "quote"
699version = "1.0.37" 1088version = "1.0.37"
700source = "registry+https://github.com/rust-lang/crates.io-index" 1089source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -704,6 +1093,36 @@ dependencies = [
704] 1093]
705 1094
706[[package]] 1095[[package]]
1096name = "rand"
1097version = "0.8.5"
1098source = "registry+https://github.com/rust-lang/crates.io-index"
1099checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
1100dependencies = [
1101 "libc",
1102 "rand_chacha",
1103 "rand_core",
1104]
1105
1106[[package]]
1107name = "rand_chacha"
1108version = "0.3.1"
1109source = "registry+https://github.com/rust-lang/crates.io-index"
1110checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
1111dependencies = [
1112 "ppv-lite86",
1113 "rand_core",
1114]
1115
1116[[package]]
1117name = "rand_core"
1118version = "0.6.4"
1119source = "registry+https://github.com/rust-lang/crates.io-index"
1120checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
1121dependencies = [
1122 "getrandom",
1123]
1124
1125[[package]]
707name = "redox_users" 1126name = "redox_users"
708version = "0.4.6" 1127version = "0.4.6"
709source = "registry+https://github.com/rust-lang/crates.io-index" 1128source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -781,16 +1200,10 @@ dependencies = [
781] 1200]
782 1201
783[[package]] 1202[[package]]
784name = "rustc-demangle"
785version = "0.1.24"
786source = "registry+https://github.com/rust-lang/crates.io-index"
787checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
788
789[[package]]
790name = "rustix" 1203name = "rustix"
791version = "0.38.36" 1204version = "0.38.37"
792source = "registry+https://github.com/rust-lang/crates.io-index" 1205source = "registry+https://github.com/rust-lang/crates.io-index"
793checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" 1206checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811"
794dependencies = [ 1207dependencies = [
795 "bitflags", 1208 "bitflags",
796 "errno", 1209 "errno",
@@ -807,18 +1220,18 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
807 1220
808[[package]] 1221[[package]]
809name = "serde" 1222name = "serde"
810version = "1.0.209" 1223version = "1.0.210"
811source = "registry+https://github.com/rust-lang/crates.io-index" 1224source = "registry+https://github.com/rust-lang/crates.io-index"
812checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" 1225checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
813dependencies = [ 1226dependencies = [
814 "serde_derive", 1227 "serde_derive",
815] 1228]
816 1229
817[[package]] 1230[[package]]
818name = "serde_derive" 1231name = "serde_derive"
819version = "1.0.209" 1232version = "1.0.210"
820source = "registry+https://github.com/rust-lang/crates.io-index" 1233source = "registry+https://github.com/rust-lang/crates.io-index"
821checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" 1234checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
822dependencies = [ 1235dependencies = [
823 "proc-macro2", 1236 "proc-macro2",
824 "quote", 1237 "quote",
@@ -838,6 +1251,17 @@ dependencies = [
838] 1251]
839 1252
840[[package]] 1253[[package]]
1254name = "serde_repr"
1255version = "0.1.19"
1256source = "registry+https://github.com/rust-lang/crates.io-index"
1257checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
1258dependencies = [
1259 "proc-macro2",
1260 "quote",
1261 "syn",
1262]
1263
1264[[package]]
841name = "serde_spanned" 1265name = "serde_spanned"
842version = "0.6.7" 1266version = "0.6.7"
843source = "registry+https://github.com/rust-lang/crates.io-index" 1267source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -847,6 +1271,17 @@ dependencies = [
847] 1271]
848 1272
849[[package]] 1273[[package]]
1274name = "sha1"
1275version = "0.10.6"
1276source = "registry+https://github.com/rust-lang/crates.io-index"
1277checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
1278dependencies = [
1279 "cfg-if",
1280 "cpufeatures",
1281 "digest",
1282]
1283
1284[[package]]
850name = "sha2" 1285name = "sha2"
851version = "0.10.8" 1286version = "0.10.8"
852source = "registry+https://github.com/rust-lang/crates.io-index" 1287source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -873,12 +1308,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
873checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1308checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
874 1309
875[[package]] 1310[[package]]
1311name = "signal-hook-registry"
1312version = "1.4.2"
1313source = "registry+https://github.com/rust-lang/crates.io-index"
1314checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
1315dependencies = [
1316 "libc",
1317]
1318
1319[[package]]
1320name = "slab"
1321version = "0.4.9"
1322source = "registry+https://github.com/rust-lang/crates.io-index"
1323checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
1324dependencies = [
1325 "autocfg",
1326]
1327
1328[[package]]
876name = "smallvec" 1329name = "smallvec"
877version = "1.13.2" 1330version = "1.13.2"
878source = "registry+https://github.com/rust-lang/crates.io-index" 1331source = "registry+https://github.com/rust-lang/crates.io-index"
879checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1332checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
880 1333
881[[package]] 1334[[package]]
1335name = "static_assertions"
1336version = "1.1.0"
1337source = "registry+https://github.com/rust-lang/crates.io-index"
1338checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
1339
1340[[package]]
882name = "strsim" 1341name = "strsim"
883version = "0.11.1" 1342version = "0.11.1"
884source = "registry+https://github.com/rust-lang/crates.io-index" 1343source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -896,19 +1355,43 @@ dependencies = [
896] 1355]
897 1356
898[[package]] 1357[[package]]
1358name = "tauri-winrt-notification"
1359version = "0.2.1"
1360source = "registry+https://github.com/rust-lang/crates.io-index"
1361checksum = "f89f5fb70d6f62381f5d9b2ba9008196150b40b75f3068eb24faeddf1c686871"
1362dependencies = [
1363 "quick-xml",
1364 "windows",
1365 "windows-version",
1366]
1367
1368[[package]]
1369name = "tempfile"
1370version = "3.12.0"
1371source = "registry+https://github.com/rust-lang/crates.io-index"
1372checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64"
1373dependencies = [
1374 "cfg-if",
1375 "fastrand",
1376 "once_cell",
1377 "rustix",
1378 "windows-sys 0.59.0",
1379]
1380
1381[[package]]
899name = "thiserror" 1382name = "thiserror"
900version = "1.0.63" 1383version = "1.0.64"
901source = "registry+https://github.com/rust-lang/crates.io-index" 1384source = "registry+https://github.com/rust-lang/crates.io-index"
902checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" 1385checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84"
903dependencies = [ 1386dependencies = [
904 "thiserror-impl", 1387 "thiserror-impl",
905] 1388]
906 1389
907[[package]] 1390[[package]]
908name = "thiserror-impl" 1391name = "thiserror-impl"
909version = "1.0.63" 1392version = "1.0.64"
910source = "registry+https://github.com/rust-lang/crates.io-index" 1393source = "registry+https://github.com/rust-lang/crates.io-index"
911checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" 1394checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
912dependencies = [ 1395dependencies = [
913 "proc-macro2", 1396 "proc-macro2",
914 "quote", 1397 "quote",
@@ -988,9 +1471,9 @@ dependencies = [
988 1471
989[[package]] 1472[[package]]
990name = "toml_edit" 1473name = "toml_edit"
991version = "0.22.20" 1474version = "0.22.22"
992source = "registry+https://github.com/rust-lang/crates.io-index" 1475source = "registry+https://github.com/rust-lang/crates.io-index"
993checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" 1476checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5"
994dependencies = [ 1477dependencies = [
995 "indexmap", 1478 "indexmap",
996 "serde", 1479 "serde",
@@ -1044,16 +1527,6 @@ dependencies = [
1044] 1527]
1045 1528
1046[[package]] 1529[[package]]
1047name = "tracing-error"
1048version = "0.2.0"
1049source = "registry+https://github.com/rust-lang/crates.io-index"
1050checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e"
1051dependencies = [
1052 "tracing",
1053 "tracing-subscriber",
1054]
1055
1056[[package]]
1057name = "tracing-log" 1530name = "tracing-log"
1058version = "0.2.0" 1531version = "0.2.0"
1059source = "registry+https://github.com/rust-lang/crates.io-index" 1532source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1095,16 +1568,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1095checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" 1568checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
1096 1569
1097[[package]] 1570[[package]]
1571name = "uds_windows"
1572version = "1.1.0"
1573source = "registry+https://github.com/rust-lang/crates.io-index"
1574checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
1575dependencies = [
1576 "memoffset",
1577 "tempfile",
1578 "winapi",
1579]
1580
1581[[package]]
1098name = "unicode-ident" 1582name = "unicode-ident"
1099version = "1.0.12" 1583version = "1.0.13"
1100source = "registry+https://github.com/rust-lang/crates.io-index" 1584source = "registry+https://github.com/rust-lang/crates.io-index"
1101checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1585checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
1102 1586
1103[[package]] 1587[[package]]
1104name = "unicode-segmentation" 1588name = "unicode-segmentation"
1105version = "1.11.0" 1589version = "1.12.0"
1106source = "registry+https://github.com/rust-lang/crates.io-index" 1590source = "registry+https://github.com/rust-lang/crates.io-index"
1107checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" 1591checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
1108 1592
1109[[package]] 1593[[package]]
1110name = "utf8parse" 1594name = "utf8parse"
@@ -1162,6 +1646,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1162checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1646checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1163 1647
1164[[package]] 1648[[package]]
1649name = "windows"
1650version = "0.56.0"
1651source = "registry+https://github.com/rust-lang/crates.io-index"
1652checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132"
1653dependencies = [
1654 "windows-core",
1655 "windows-targets 0.52.6",
1656]
1657
1658[[package]]
1659name = "windows-core"
1660version = "0.56.0"
1661source = "registry+https://github.com/rust-lang/crates.io-index"
1662checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6"
1663dependencies = [
1664 "windows-implement",
1665 "windows-interface",
1666 "windows-result",
1667 "windows-targets 0.52.6",
1668]
1669
1670[[package]]
1671name = "windows-implement"
1672version = "0.56.0"
1673source = "registry+https://github.com/rust-lang/crates.io-index"
1674checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b"
1675dependencies = [
1676 "proc-macro2",
1677 "quote",
1678 "syn",
1679]
1680
1681[[package]]
1682name = "windows-interface"
1683version = "0.56.0"
1684source = "registry+https://github.com/rust-lang/crates.io-index"
1685checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc"
1686dependencies = [
1687 "proc-macro2",
1688 "quote",
1689 "syn",
1690]
1691
1692[[package]]
1693name = "windows-result"
1694version = "0.1.2"
1695source = "registry+https://github.com/rust-lang/crates.io-index"
1696checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
1697dependencies = [
1698 "windows-targets 0.52.6",
1699]
1700
1701[[package]]
1165name = "windows-sys" 1702name = "windows-sys"
1166version = "0.48.0" 1703version = "0.48.0"
1167source = "registry+https://github.com/rust-lang/crates.io-index" 1704source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1180,6 +1717,15 @@ dependencies = [
1180] 1717]
1181 1718
1182[[package]] 1719[[package]]
1720name = "windows-sys"
1721version = "0.59.0"
1722source = "registry+https://github.com/rust-lang/crates.io-index"
1723checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
1724dependencies = [
1725 "windows-targets 0.52.6",
1726]
1727
1728[[package]]
1183name = "windows-targets" 1729name = "windows-targets"
1184version = "0.48.5" 1730version = "0.48.5"
1185source = "registry+https://github.com/rust-lang/crates.io-index" 1731source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1211,6 +1757,15 @@ dependencies = [
1211] 1757]
1212 1758
1213[[package]] 1759[[package]]
1760name = "windows-version"
1761version = "0.1.1"
1762source = "registry+https://github.com/rust-lang/crates.io-index"
1763checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515"
1764dependencies = [
1765 "windows-targets 0.52.6",
1766]
1767
1768[[package]]
1214name = "windows_aarch64_gnullvm" 1769name = "windows_aarch64_gnullvm"
1215version = "0.48.5" 1770version = "0.48.5"
1216source = "registry+https://github.com/rust-lang/crates.io-index" 1771source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1302,9 +1857,148 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
1302 1857
1303[[package]] 1858[[package]]
1304name = "winnow" 1859name = "winnow"
1305version = "0.6.18" 1860version = "0.6.19"
1306source = "registry+https://github.com/rust-lang/crates.io-index" 1861source = "registry+https://github.com/rust-lang/crates.io-index"
1307checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" 1862checksum = "c52ac009d615e79296318c1bcce2d422aaca15ad08515e344feeda07df67a587"
1308dependencies = [ 1863dependencies = [
1309 "memchr", 1864 "memchr",
1310] 1865]
1866
1867[[package]]
1868name = "xdg-home"
1869version = "1.3.0"
1870source = "registry+https://github.com/rust-lang/crates.io-index"
1871checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6"
1872dependencies = [
1873 "libc",
1874 "windows-sys 0.59.0",
1875]
1876
1877[[package]]
1878name = "yaml-rust"
1879version = "0.4.5"
1880source = "registry+https://github.com/rust-lang/crates.io-index"
1881checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
1882dependencies = [
1883 "linked-hash-map",
1884]
1885
1886[[package]]
1887name = "zbus"
1888version = "4.4.0"
1889source = "registry+https://github.com/rust-lang/crates.io-index"
1890checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725"
1891dependencies = [
1892 "async-broadcast",
1893 "async-executor",
1894 "async-fs",
1895 "async-io",
1896 "async-lock",
1897 "async-process",
1898 "async-recursion",
1899 "async-task",
1900 "async-trait",
1901 "blocking",
1902 "enumflags2",
1903 "event-listener",
1904 "futures-core",
1905 "futures-sink",
1906 "futures-util",
1907 "hex",
1908 "nix",
1909 "ordered-stream",
1910 "rand",
1911 "serde",
1912 "serde_repr",
1913 "sha1",
1914 "static_assertions",
1915 "tracing",
1916 "uds_windows",
1917 "windows-sys 0.52.0",
1918 "xdg-home",
1919 "zbus_macros",
1920 "zbus_names",
1921 "zvariant",
1922]
1923
1924[[package]]
1925name = "zbus_macros"
1926version = "4.4.0"
1927source = "registry+https://github.com/rust-lang/crates.io-index"
1928checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e"
1929dependencies = [
1930 "proc-macro-crate",
1931 "proc-macro2",
1932 "quote",
1933 "syn",
1934 "zvariant_utils",
1935]
1936
1937[[package]]
1938name = "zbus_names"
1939version = "3.0.0"
1940source = "registry+https://github.com/rust-lang/crates.io-index"
1941checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c"
1942dependencies = [
1943 "serde",
1944 "static_assertions",
1945 "zvariant",
1946]
1947
1948[[package]]
1949name = "zerocopy"
1950version = "0.7.35"
1951source = "registry+https://github.com/rust-lang/crates.io-index"
1952checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
1953dependencies = [
1954 "byteorder",
1955 "zerocopy-derive",
1956]
1957
1958[[package]]
1959name = "zerocopy-derive"
1960version = "0.7.35"
1961source = "registry+https://github.com/rust-lang/crates.io-index"
1962checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
1963dependencies = [
1964 "proc-macro2",
1965 "quote",
1966 "syn",
1967]
1968
1969[[package]]
1970name = "zvariant"
1971version = "4.2.0"
1972source = "registry+https://github.com/rust-lang/crates.io-index"
1973checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe"
1974dependencies = [
1975 "endi",
1976 "enumflags2",
1977 "serde",
1978 "static_assertions",
1979 "zvariant_derive",
1980]
1981
1982[[package]]
1983name = "zvariant_derive"
1984version = "4.2.0"
1985source = "registry+https://github.com/rust-lang/crates.io-index"
1986checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449"
1987dependencies = [
1988 "proc-macro-crate",
1989 "proc-macro2",
1990 "quote",
1991 "syn",
1992 "zvariant_utils",
1993]
1994
1995[[package]]
1996name = "zvariant_utils"
1997version = "2.1.0"
1998source = "registry+https://github.com/rust-lang/crates.io-index"
1999checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340"
2000dependencies = [
2001 "proc-macro2",
2002 "quote",
2003 "syn",
2004]
diff --git a/Cargo.toml b/Cargo.toml
index 9fcca11..9a24ac3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,33 +3,21 @@ name = "arbs"
3edition = "2021" 3edition = "2021"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[features]
7default = ["notifications"]
8notifications = ["dep:notify-rust"]
9
6[dependencies] 10[dependencies]
7color-eyre = "0.6.3"
8dirs = "5.0.1" 11dirs = "5.0.1"
9gethostname = "0.5.0" 12gethostname = "0.5.0"
10serde_json = "1.0.128" 13notify-rust = { version = "4.11.3", optional = true}
14serde_json = { default-features = false, version = "1.0.128" }
11thiserror = "1.0.63" 15thiserror = "1.0.63"
12toml = "0.8.19" 16toml = { default-features = false, version = "0.8.19" }
13tracing = "0.1.40" 17tracing = { default-features = false, version = "0.1.40" }
14tracing-appender = "0.2.3" 18tracing-appender = "0.2.3"
15 19clap = { version = "4.5.17", features = ["derive"] }
16[dependencies.clap] 20config = { version = "0.14.0" }
17version = "4.5.17" 21serde = { version = "1.0.209", features = ["derive"] }
18features = ["derive"] 22tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
19 23uuid = { version = "1.10.0", features = ["v4"] }
20[dependencies.config]
21version = "0.14.0"
22features = ["ini", "toml", "json5", "ron", "json", "convert-case", "async"]
23default-features = false
24
25[dependencies.serde]
26version = "1.0.209"
27features = ["derive"]
28
29[dependencies.tracing-subscriber]
30version = "0.3.18"
31features = ["env-filter"]
32
33[dependencies.uuid]
34version = "1.10.0"
35features = ["v4"]
diff --git a/assets/icon.png b/assets/icon.png
new file mode 100644
index 0000000..ae95463
--- /dev/null
+++ b/assets/icon.png
Binary files differ
diff --git a/src/backup.rs b/src/backup.rs
index 3d07ace..b468917 100644
--- a/src/backup.rs
+++ b/src/backup.rs
@@ -2,18 +2,18 @@ use std::{
2 fs::{create_dir_all, File}, 2 fs::{create_dir_all, File},
3 io::{Read, Write}, 3 io::{Read, Write},
4 path::PathBuf, 4 path::PathBuf,
5 time::{SystemTime, UNIX_EPOCH}, 5 time::SystemTime,
6}; 6};
7 7
8use serde::{Deserialize, Serialize}; 8use serde::{Deserialize, Serialize};
9use tracing::info; 9use tracing::{debug, info};
10use uuid::Uuid; 10use uuid::Uuid;
11 11
12use crate::{ 12use crate::{
13 config::Config, 13 config::Config,
14 error::{Error, Result}, 14 error::{Error, Result},
15 packages::{Manager, PackageList}, 15 packages::PackageList,
16 pathinfo::PathInfo, 16 pathinfo::PathInfo, send_notification,
17}; 17};
18 18
19pub type Id = String; 19pub type Id = String;
@@ -28,16 +28,20 @@ pub struct Backup {
28} 28}
29 29
30impl Backup { 30impl Backup {
31 pub fn create(config: &Config, manager: Option<Manager>) -> Result<Self> { 31 pub fn create(config: &Config) -> Result<Self> {
32 let mut files: Vec<PathInfo> = Vec::new(); 32 let mut files: Vec<PathInfo> = Vec::new();
33 for dir in &config.directories { 33 for dir in &config.directories {
34 files.push(PathInfo::from_path(config, dir)?); 34 files.push(PathInfo::from_path(config, dir)?);
35 } 35 }
36 Ok(Self { 36 Ok(Self {
37 // TODO: UUID not really needed, maybe a shorter hash
38 id: Uuid::new_v4().to_string(), 37 id: Uuid::new_v4().to_string(),
39 timestamp: Self::get_timestamp(), 38 timestamp: SystemTime::now()
40 packages: Manager::get_manager(manager)?.get_installed()?, 39 .duration_since(SystemTime::UNIX_EPOCH)?
40 .as_secs(),
41 packages: config
42 .package_manager
43 .to_package_manager()
44 .get_installed()?,
41 files, 45 files,
42 device: config.device.clone(), 46 device: config.device.clone(),
43 }) 47 })
@@ -58,12 +62,14 @@ impl Backup {
58 path.save(&backup_root)?; 62 path.save(&backup_root)?;
59 } 63 }
60 64
65 send_notification("Backup created" , "", notify_rust::Urgency::Normal)?;
66
61 Ok(()) 67 Ok(())
62 } 68 }
63 69
64 pub fn get_last(config: &Config) -> Result<Option<Self>> { 70 pub fn get_last(config: &Config) -> Result<Option<Self>> {
65 let backup_index_root = format!("{}/index.json", config.root); 71 let backup_index_root = format!("{}/index.json", config.root);
66 info!(?backup_index_root, "backup index location:"); 72 debug!(?backup_index_root, "backup index location:");
67 let list: Vec<IndexEntry> = match Self::get_json_content(&backup_index_root) { 73 let list: Vec<IndexEntry> = match Self::get_json_content(&backup_index_root) {
68 Ok(list) => list, 74 Ok(list) => list,
69 Err(err) => { 75 Err(err) => {
@@ -74,8 +80,6 @@ impl Backup {
74 } 80 }
75 }; 81 };
76 82
77 info!(?list, "backup index:");
78
79 Ok(Some(Self::from_index( 83 Ok(Some(Self::from_index(
80 config, 84 config,
81 &list.last().ok_or(Error::BackupNotFound)?.id, 85 &list.last().ok_or(Error::BackupNotFound)?.id,
@@ -122,6 +126,8 @@ impl Backup {
122 path.restore(config, &backup_root)?; 126 path.restore(config, &backup_root)?;
123 } 127 }
124 128
129 send_notification("Backup restored" , "", notify_rust::Urgency::Normal)?;
130
125 Ok(()) 131 Ok(())
126 } 132 }
127 133
@@ -131,13 +137,6 @@ impl Backup {
131 file.read_to_string(&mut content)?; 137 file.read_to_string(&mut content)?;
132 Ok(serde_json::from_str(&content)?) 138 Ok(serde_json::from_str(&content)?)
133 } 139 }
134
135 fn get_timestamp() -> u64 {
136 SystemTime::now()
137 .duration_since(UNIX_EPOCH)
138 .unwrap()
139 .as_secs()
140 }
141} 140}
142 141
143#[derive(Debug, Clone, Serialize, Deserialize)] 142#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -165,7 +164,7 @@ impl IndexEntry {
165 164
166 f.write_all(&serde_json::to_vec(&loc)?)?; 165 f.write_all(&serde_json::to_vec(&loc)?)?;
167 } else { 166 } else {
168 create_dir_all(&config.root).unwrap(); 167 create_dir_all(&config.root)?;
169 let mut f = File::create(backup_index_root)?; 168 let mut f = File::create(backup_index_root)?;
170 f.write_all(&serde_json::to_vec(&vec![self])?)?; 169 f.write_all(&serde_json::to_vec(&vec![self])?)?;
171 }; 170 };
diff --git a/src/cli.rs b/src/cli.rs
index 1b62a84..588b6b0 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -2,8 +2,6 @@ use std::path::PathBuf;
2 2
3use clap::{Parser, Subcommand}; 3use clap::{Parser, Subcommand};
4 4
5use crate::packages::Manager;
6
7#[derive(Parser)] 5#[derive(Parser)]
8pub struct Cli { 6pub struct Cli {
9 #[arg(short, long)] 7 #[arg(short, long)]
@@ -16,10 +14,7 @@ pub struct Cli {
16#[derive(Subcommand)] 14#[derive(Subcommand)]
17pub enum Subcommands { 15pub enum Subcommands {
18 GenerateConfig, 16 GenerateConfig,
19 Save { 17 Save,
20 #[arg(short, long)]
21 package_manager: Option<Manager>,
22 },
23 Restore { 18 Restore {
24 #[arg(short, long)] 19 #[arg(short, long)]
25 package_install: bool 20 package_install: bool
diff --git a/src/config.rs b/src/config.rs
index 46d2204..848be19 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -4,6 +4,8 @@ use config::{File, Map};
4use serde::{Deserialize, Serialize}; 4use serde::{Deserialize, Serialize};
5use tracing::{debug, trace}; 5use tracing::{debug, trace};
6 6
7use crate::{error::{Error, Result}, packages::Manager};
8
7#[derive(Debug, Serialize, Deserialize)] 9#[derive(Debug, Serialize, Deserialize)]
8#[serde(default)] 10#[serde(default)]
9pub struct Config { 11pub struct Config {
@@ -11,6 +13,7 @@ pub struct Config {
11 pub directories: Vec<String>, 13 pub directories: Vec<String>,
12 pub custom_directories: Map<String, String>, 14 pub custom_directories: Map<String, String>,
13 pub device: String, 15 pub device: String,
16 pub package_manager: Manager,
14} 17}
15 18
16impl Default for Config { 19impl Default for Config {
@@ -22,17 +25,18 @@ impl Default for Config {
22 device: gethostname::gethostname() 25 device: gethostname::gethostname()
23 .into_string() 26 .into_string()
24 .expect("invalid hostname string"), 27 .expect("invalid hostname string"),
28 package_manager: Manager::from_sys().expect("couldn't get package manager"),
25 } 29 }
26 } 30 }
27} 31}
28 32
29impl Config { 33impl Config {
30 pub fn load(path: Option<PathBuf>) -> core::result::Result<Self, config::ConfigError> { 34 pub fn load(path: Option<PathBuf>) -> Result<Self> {
31 debug!("load config"); 35 debug!("load config");
32 let source = if let Some(source) = path { 36 let source = if let Some(source) = path {
33 source 37 source
34 } else { 38 } else {
35 Self::get_location() 39 Self::get_location()?
36 }; 40 };
37 41
38 let config = config::Config::builder() 42 let config = config::Config::builder()
@@ -40,14 +44,14 @@ impl Config {
40 .add_source(config::Environment::with_prefix("FXBAUP").separator("_")) 44 .add_source(config::Environment::with_prefix("FXBAUP").separator("_"))
41 .build()?; 45 .build()?;
42 46
43 let cfg = config.try_deserialize(); 47 let cfg = config.try_deserialize()?;
44 trace!(?cfg, "loaded config"); 48 trace!(?cfg, "loaded config");
45 49
46 cfg 50 Ok(cfg)
47 } 51 }
48 52
49 pub fn generate() -> crate::error::Result<()> { 53 pub fn generate() -> Result<()> {
50 let loc = Self::get_location(); 54 let loc = Self::get_location()?;
51 create_dir_all(loc.parent().unwrap())?; 55 create_dir_all(loc.parent().unwrap())?;
52 let mut f = std::fs::File::create(loc)?; 56 let mut f = std::fs::File::create(loc)?;
53 f.write_all(toml::to_string(&Self::default())?.as_bytes())?; 57 f.write_all(toml::to_string(&Self::default())?.as_bytes())?;
@@ -55,10 +59,12 @@ impl Config {
55 Ok(()) 59 Ok(())
56 } 60 }
57 61
58 fn get_location() -> PathBuf { 62 fn get_location() -> Result<PathBuf> {
59 let mut conf_dir = dirs::config_local_dir().unwrap(); 63 let Some(mut config_dir) = dirs::config_dir() else {
60 conf_dir.push("arbs"); 64 return Err(Error::NoSysDir);
61 conf_dir.push("config.toml"); 65 };
62 conf_dir 66 config_dir.push(env!("CARGO_PKG_NAME"));
67 config_dir.push("config.toml");
68 Ok(config_dir)
63 } 69 }
64} 70}
diff --git a/src/error.rs b/src/error.rs
index cb57e99..8270b45 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,3 +1,5 @@
1use tracing::error;
2
1pub type Result<T> = std::result::Result<T, Error>; 3pub type Result<T> = std::result::Result<T, Error>;
2 4
3#[derive(Debug, thiserror::Error)] 5#[derive(Debug, thiserror::Error)]
@@ -17,6 +19,10 @@ pub enum Error {
17 #[error("Requested backup not found")] 19 #[error("Requested backup not found")]
18 BackupNotFound, 20 BackupNotFound,
19 21
22 // Utils
23 #[error("System directory not found")]
24 NoSysDir,
25
20 // Packages 26 // Packages
21 #[error("Unknown Package Manger Output")] 27 #[error("Unknown Package Manger Output")]
22 UnknownOutput, 28 UnknownOutput,
@@ -26,11 +32,22 @@ pub enum Error {
26 32
27 // Deps 33 // Deps
28 #[error(transparent)] 34 #[error(transparent)]
35 Config(#[from] config::ConfigError),
36
37 #[error(transparent)]
29 SerdeJson(#[from] serde_json::Error), 38 SerdeJson(#[from] serde_json::Error),
30 39
31 #[error(transparent)] 40 #[error(transparent)]
32 TomlSerialize(#[from] toml::ser::Error), 41 TomlSerialize(#[from] toml::ser::Error),
33 42
43 #[cfg(feature = "notifications")]
44 #[error(transparent)]
45 Notify(#[from] notify_rust::error::Error),
46
47 // Rust
34 #[error(transparent)] 48 #[error(transparent)]
35 Io(#[from] std::io::Error), 49 Io(#[from] std::io::Error),
50
51 #[error(transparent)]
52 SystemTime(#[from] std::time::SystemTimeError),
36} 53}
diff --git a/src/main.rs b/src/main.rs
index 487d095..ab23ab7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,8 +2,9 @@ use backup::Backup;
2use clap::Parser; 2use clap::Parser;
3use cli::Subcommands; 3use cli::Subcommands;
4use config::Config; 4use config::Config;
5use error::Error; 5use error::{Error, Result};
6use tracing::{debug, level_filters::LevelFilter}; 6use notify_rust::Urgency;
7use tracing::{debug, error, level_filters::LevelFilter};
7use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; 8use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
8 9
9mod backup; 10mod backup;
@@ -13,9 +14,7 @@ mod error;
13mod packages; 14mod packages;
14mod pathinfo; 15mod pathinfo;
15 16
16fn main() -> color_eyre::Result<()> { 17fn main() -> Result<()> {
17 color_eyre::install()?;
18
19 let file_appender = tracing_appender::rolling::never("./", "arbs.log"); 18 let file_appender = tracing_appender::rolling::never("./", "arbs.log");
20 let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender); 19 let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
21 20
@@ -35,15 +34,27 @@ fn main() -> color_eyre::Result<()> {
35 ) 34 )
36 .init(); 35 .init();
37 debug!("logging initialized"); 36 debug!("logging initialized");
37
38 match run_cli() {
39 Ok(()) => { println!("OK") ; Ok(())},
40 Err(err) => {
41 error!(?err);
42 error!("{:?}", std::error::Error::source(&err));
43 send_notification("Backup Error", &err.to_string(), Urgency::Critical)?;
44 Err(err)
45 }
46 }
47}
38 48
49fn run_cli() -> Result<()> {
39 let cli = cli::Cli::parse(); 50 let cli = cli::Cli::parse();
40 51
41 let config = Config::load(cli.config)?; 52 let config = Config::load(cli.config)?;
42 53
43 match cli.subcommand { 54 match cli.subcommand {
44 Subcommands::GenerateConfig => Config::generate()?, 55 Subcommands::GenerateConfig => Config::generate()?,
45 Subcommands::Save { package_manager } => { 56 Subcommands::Save => {
46 let backup = Backup::create(&config, package_manager)?; 57 let backup = Backup::create(&config)?;
47 backup.save(&config)?; 58 backup.save(&config)?;
48 } 59 }
49 Subcommands::Restore { package_install } => { 60 Subcommands::Restore { package_install } => {
@@ -56,7 +67,27 @@ fn main() -> color_eyre::Result<()> {
56 } 67 }
57 68
58 last_backup.restore(&config)?; 69 last_backup.restore(&config)?;
59 } 70 },
60 }; 71 };
61 Ok(()) 72 Ok(())
62} 73}
74
75fn send_notification(summary: &str, body: &str, urgency: Urgency) -> Result<()> {
76 #[cfg(feature = "notifications")]
77 {
78 let Some(mut icon) = dirs::data_dir() else {
79 return Err(Error::NoSysDir);
80 };
81 icon.push(env!("CARGO_PKG_NAME"));
82 icon.push("icon.png");
83
84 notify_rust::Notification::new()
85 .summary(summary)
86 .body(body)
87 .icon(&icon.to_string_lossy())
88 .timeout(0)
89 .urgency(urgency)
90 .show()?;
91 }
92 Ok(())
93}
diff --git a/src/packages.rs b/src/packages.rs
index de818f4..41b9478 100644
--- a/src/packages.rs
+++ b/src/packages.rs
@@ -37,15 +37,12 @@ pub enum Manager {
37} 37}
38 38
39impl Manager { 39impl Manager {
40 pub fn get_manager(manager: Option<Manager>) -> Result<Box<dyn PackageManager>> { 40 pub fn from_sys() -> Result<Self> {
41 #[cfg(not(target_os = "linux"))] 41 #[cfg(not(target_os = "linux"))]
42 return Err(Error::Unsupported); 42 return Err(Error::Unsupported);
43 43
44 #[cfg(target_os = "linux")] 44 #[cfg(target_os = "linux")]
45 { 45 {
46 if let Some(man) = manager {
47 return Ok(man.to_package_manager());
48 }
49 let mut os_release = File::open("/etc/os-release")?; 46 let mut os_release = File::open("/etc/os-release")?;
50 let mut content = String::new(); 47 let mut content = String::new();
51 os_release.read_to_string(&mut content)?; 48 os_release.read_to_string(&mut content)?;
@@ -63,15 +60,15 @@ impl Manager {
63 } 60 }
64 } 61 }
65 62
66 fn from_str(value: &str) -> Result<Box<dyn PackageManager>> { 63 fn from_str(value: &str) -> Result<Self> {
67 Ok(match value { 64 Ok(match value {
68 "arch" => Box::new(Pacman), 65 "arch" => Self::Pacman,
69 "gentoo" => Box::new(Portage), 66 "gentoo" => Self::Portage,
70 _ => return Err(Error::Unsupported), 67 _ => return Err(Error::Unsupported),
71 }) 68 })
72 } 69 }
73 70
74 fn to_package_manager(&self) -> Box<dyn PackageManager> { 71 pub fn to_package_manager(&self) -> Box<dyn PackageManager> {
75 match self { 72 match self {
76 Self::Pacman => Box::new(Pacman), 73 Self::Pacman => Box::new(Pacman),
77 Self::Portage => Box::new(Portage), 74 Self::Portage => Box::new(Portage),
diff --git a/src/pathinfo.rs b/src/pathinfo.rs
index 1231ff8..009f46a 100644
--- a/src/pathinfo.rs
+++ b/src/pathinfo.rs
@@ -6,7 +6,7 @@ use std::{
6}; 6};
7 7
8use serde::{Deserialize, Serialize}; 8use serde::{Deserialize, Serialize};
9use tracing::{debug, info}; 9use tracing::{debug, info, trace};
10 10
11use crate::{ 11use crate::{
12 backup::{Backup, Id}, 12 backup::{Backup, Id},
@@ -35,7 +35,7 @@ impl PathInfo {
35 rel_location: &str, 35 rel_location: &str,
36 location_root: &LocationRoot, 36 location_root: &LocationRoot,
37 ) -> Result<Self> { 37 ) -> Result<Self> {
38 info!("Handling {rel_location}"); 38 trace!("Handling {rel_location}");
39 let path = Self::get_abs_path(&location_root.to_string(), rel_location); 39 let path = Self::get_abs_path(&location_root.to_string(), rel_location);
40 Ok(if path.is_dir() { 40 Ok(if path.is_dir() {
41 let mut last_modified = Some(String::new()); 41 let mut last_modified = Some(String::new());
@@ -83,7 +83,7 @@ impl PathInfo {
83 ) -> Result<Self> { 83 ) -> Result<Self> {
84 let last_modified = Self::compare_to_last_modified(config, location_root, rel_location)?; 84 let last_modified = Self::compare_to_last_modified(config, location_root, rel_location)?;
85 85
86 info!("From file {rel_location} ({last_modified:?})"); 86 debug!("From file {rel_location} ({last_modified:?})");
87 87
88 Ok(Self { 88 Ok(Self {
89 rel_location: rel_location.to_string(), 89 rel_location: rel_location.to_string(),
@@ -301,14 +301,15 @@ mod tests {
301 .custom_directories 301 .custom_directories
302 .insert("test".to_string(), "/usr/local/test".to_string()); 302 .insert("test".to_string(), "/usr/local/test".to_string());
303 303
304 let mut values_ok: Vec<(&str, LocationRoot)> = Vec::new(); 304 let values_ok = vec![
305 values_ok.push(("u:test", LocationRoot::User)); 305 ("u:test", LocationRoot::User),
306 values_ok.push(("s:", LocationRoot::SystemConfig)); 306 ("s:", LocationRoot::SystemConfig),
307 values_ok.push(("r:", LocationRoot::Root)); 307 ("r:", LocationRoot::Root),
308 values_ok.push(( 308 (
309 "c:test", 309 "c:test",
310 LocationRoot::Custom("/usr/local/test".to_string()), 310 LocationRoot::Custom("/usr/local/test".to_string()),
311 )); 311 ),
312 ];
312 313
313 for value in values_ok { 314 for value in values_ok {
314 println!("Testing {value:?}"); 315 println!("Testing {value:?}");
@@ -316,18 +317,19 @@ mod tests {
316 println!("\x1B[FTesting {value:?} ✓"); 317 println!("\x1B[FTesting {value:?} ✓");
317 } 318 }
318 319
319 let mut values_err: Vec<(&str, String)> = Vec::new(); 320 let values_err = vec![
320 values_err.push(( 321 (
321 "c:rest", 322 "c:rest",
322 Error::CustomDirectory("rest".to_string()).to_string(), 323 Error::CustomDirectory("rest".to_string()).to_string(),
323 )); 324 ),
324 values_err.push(("t:test/", Error::InvalidIndex("t".to_string()).to_string())); 325 ("t:test/", Error::InvalidIndex("t".to_string()).to_string()),
325 values_err.push(( 326 (
326 "test:test/usr", 327 "test:test/usr",
327 Error::InvalidIndex("test".to_string()).to_string(), 328 Error::InvalidIndex("test".to_string()).to_string(),
328 )); 329 ),
329 values_err.push(("/usr/local/test", Error::NoIndex.to_string())); 330 ("/usr/local/test", Error::NoIndex.to_string()),
330 values_err.push(("c/usr/local/test", Error::NoIndex.to_string())); 331 ("c/usr/local/test", Error::NoIndex.to_string()),
332 ];
331 333
332 for value in values_err { 334 for value in values_err {
333 println!("Testing {value:?}"); 335 println!("Testing {value:?}");
@@ -351,47 +353,47 @@ mod tests {
351 .custom_directories 353 .custom_directories
352 .insert("test".to_string(), "/usr/local/test".to_string()); 354 .insert("test".to_string(), "/usr/local/test".to_string());
353 355
354 let mut values_ok: Vec<(&str, (String, LocationRoot))> = Vec::new(); 356 let values_ok = vec![
355 values_ok.push((
356 "~/.config/nvim",
357 (".config/nvim".to_string(), LocationRoot::User),
358 ));
359 values_ok.push((
360 "u:test/.config/nvim",
361 (".config/nvim".to_string(), LocationRoot::User),
362 ));
363 values_ok.push((
364 "r:/.config/nvim",
365 (".config/nvim".to_string(), LocationRoot::Root),
366 ));
367 values_ok.push((
368 "r:/.config/nvim",
369 (".config/nvim".to_string(), LocationRoot::Root),
370 ));
371 values_ok.push((
372 "s:/.config/nvim",
373 (".config/nvim".to_string(), LocationRoot::SystemConfig),
374 ));
375 values_ok.push((
376 "c:test/.config/nvim",
377 ( 357 (
378 ".config/nvim".to_string(), 358 "~/.config/nvim",
379 LocationRoot::Custom("/usr/local/test".to_string()), 359 (".config/nvim".to_string(), LocationRoot::User),
360 ),
361 (
362 "u:test/.config/nvim",
363 (".config/nvim".to_string(), LocationRoot::User),
380 ), 364 ),
381 )); 365 (
366 "r:/.config/nvim",
367 (".config/nvim".to_string(), LocationRoot::Root),
368 ),
369 (
370 "r:/.config/nvim",
371 (".config/nvim".to_string(), LocationRoot::Root),
372 ),
373 (
374 "s:/.config/nvim",
375 (".config/nvim".to_string(), LocationRoot::SystemConfig),
376 ),
377 (
378 "c:test/.config/nvim",
379 (
380 ".config/nvim".to_string(),
381 LocationRoot::Custom("/usr/local/test".to_string()),
382 ),
383 ),
384 ];
382 385
383 for value in values_ok { 386 for value in values_ok {
384 print!("Testing {value:?}"); 387 print!("Testing {value:?}");
385 assert_eq!(PathInfo::parse_location(&value.0, &config)?, value.1); 388 assert_eq!(PathInfo::parse_location(value.0, &config)?, value.1);
386 println!("\x1B[FTesting {value:?} ✓"); 389 println!("\x1B[FTesting {value:?} ✓");
387 } 390 }
388 Ok(()) 391 Ok(())
389 } 392 }
390 393
391 #[test] 394 #[test]
392 fn compare_to_last_modified() -> color_eyre::Result<()> { 395 fn compare_to_last_modified() -> Result<()> {
393 let mut config = Config::default(); 396 let mut config = Config { root: "./backup-test".to_string(), ..Default::default() };
394 config.root = "./backup-test".to_string();
395 config 397 config
396 .directories 398 .directories
397 .push("u:fx/code/proj/arbs/backup-test-dir".to_string()); 399 .push("u:fx/code/proj/arbs/backup-test-dir".to_string());
@@ -404,7 +406,7 @@ mod tests {
404 let mut f = File::create("./backup-test-dir/nothing.txt")?; 406 let mut f = File::create("./backup-test-dir/nothing.txt")?;
405 f.write_all("unmodified".as_bytes())?; 407 f.write_all("unmodified".as_bytes())?;
406 408
407 let backup = Backup::create(&config, None)?; 409 let backup = Backup::create(&config)?;
408 backup.save(&config)?; 410 backup.save(&config)?;
409 411
410 let mut f = File::create("./backup-test-dir/size.txt")?; 412 let mut f = File::create("./backup-test-dir/size.txt")?;