Commit graph

1220 commits

Author SHA1 Message Date
Jiahao XU
be5e8616a2
Impl new fn helpers::extracter::untar
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 13:15:23 +10:00
Jiahao XU
cc13a23b07
Mark all internal types & fn as pub(crate)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 12:58:39 +10:00
Félix Saparelli
9ac40bb943
Merge pull request #166 from NobodyXu/optimize/quickinstall-report 2022-06-09 09:38:58 +12:00
Félix Saparelli
d0fed45ab5
Merge pull request #169 from NobodyXu/add-ci 2022-06-09 09:38:22 +12:00
Jiahao XU
951dacd03d
Fix cache key used in workflow "ci"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 02:00:38 +10:00
Jiahao XU
14823fbae7
Fix test::parse_meta in lib.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:53:24 +10:00
Jiahao XU
c9bd741c9b
Add new workflow ci
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:53:10 +10:00
Jiahao XU
1c40848f51
Rm ci.yml
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:52:30 +10:00
Jiahao XU
4b6b3e667c
Fix syntax err in workflow "ci"
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:48:42 +10:00
Jiahao XU
2ea03f6b29
Add new workflow "ci" to run cargo-test
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:44:31 +10:00
Jiahao XU
441e004ef1
Fix test::parse_meta in lib.rs
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:42:13 +10:00
Jiahao XU
784d1f0bf6
Impl new fn helpers::download_and_extract
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:32:38 +10:00
Jiahao XU
c3b5cb11c2
Support for any PkgFmt in AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:20:37 +10:00
Jiahao XU
58c775a648
Rename mod receiver_as_readable to readable_rx
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:02:53 +10:00
Jiahao XU
59544e8b55
Use BinstallError in AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 01:01:37 +10:00
Jiahao XU
f211788052
Impl ReadableRx in mod receiver_as_readable
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 23:04:14 +10:00
Jiahao XU
6bc04340b6
Impl extract_compressed_from_readable and unzip
in new mod `extracter`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 22:46:20 +10:00
Jiahao XU
894f9b49f9
Simplify AsyncFileWriter::new: Ret Self
instead of `io::Result<Self>`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 22:29:04 +10:00
Jiahao XU
911c52d8e1
Auto remove file in AsyncFileWriter
unless done is called.

Also moves creation of the dir/file into the blocking thread to avoid
blocking.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 22:27:19 +10:00
Jiahao XU
5d70f61317
Refactor: Extract AutoAbortJoinHandle
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 21:46:32 +10:00
Jiahao XU
358bea5c6d
Refactor: Extract AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 21:43:09 +10:00
Jiahao XU
6aced2ca9b
Disable feature "macros" of dep tokio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 21:38:44 +10:00
Jiahao XU
e584b99240
Simplify AsyncFileWriter::write by closing rx on err
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 21:38:05 +10:00
Jiahao XU
d9bcca8b78
Impl AutoAbortJoinHandle::new & make its field private
plus change all its users to use its new APIs.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:53:49 +10:00
Jiahao XU
f41391a53c
Impl Future for AutoAbortJoinHandle
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:51:59 +10:00
Jiahao XU
52210d1a8c
Impl Deref{Mut} for AutoAbortJoinHandle
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:48:31 +10:00
Jiahao XU
d6a372a160
Use AutoAbortJoinHandle in AsyncFileWriter
to cancel the task on failure.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:46:00 +10:00
Jiahao XU
12931fc024
Refactor: Mv AutoAbortJoinHandle into helpers
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:44:20 +10:00
Jiahao XU
6367bfc1e3
Fix infinite block in AsyncFileWriter::write
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:42:22 +10:00
Jiahao XU
90186f0b15
Update Cargo.lock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:40:02 +10:00
Jiahao XU
24d3a2af2b
Enable feature "macros" on dep tokio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:39:39 +10:00
Jiahao XU
c7965ceb4f
Use ScopeGuard to auto remove file on failure
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:23:03 +10:00
Jiahao XU
80706dc3c4
Update Cargo.lock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:12:53 +10:00
Jiahao XU
ba21372134
Add new dep scopeguard v1.1.0
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:12:37 +10:00
Jiahao XU
191fd6e981
Use AsyncFileWriter in helpers::download
so that writing to file will not block the download.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:11:01 +10:00
Jiahao XU
5fdeea86ad
Impl helpers::AsyncFileWriter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 20:03:58 +10:00
Jiahao XU
570febdaad
Update Cargo.lock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 19:43:56 +10:00
Jiahao XU
33e61f544a
Add new dep bytes v1.1.0
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 19:43:41 +10:00
Jiahao XU
6988264e99
Update Cargo.lock
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 19:38:45 +10:00
Jiahao XU
2e25360e82
Enable feature "sync" of dep tokio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 19:38:26 +10:00
Jiahao XU
3b88913013
Add new dep futures-util v0.3.21 without default feature
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 19:37:52 +10:00
Jiahao XU
dab790deaf
Enable feature "stream" of dep reqwest
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 19:33:56 +10:00
Jiahao XU
cf87abba16
Run QuickInstall reporting using tokio::spawn
So that it is run in concurrent or even in parallel with the
`remote_exists`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-08 19:13:10 +10:00
Félix Saparelli
43d5a6bdb1
(cargo-release) version 0.9.1 2022-06-08 17:17:00 +12:00
Félix Saparelli
fdbf186561
(cargo-release) version 0.9.0 2022-06-08 17:16:28 +12:00
Félix Saparelli
bd6aec9abb
Merge pull request #154 from passcod/ed-2021 2022-06-08 17:11:35 +12:00
Félix Saparelli
b4df4d0de3
Update deps 2022-06-08 16:54:42 +12:00
Félix Saparelli
aad708a035
Slightly more ergo clone by ordering 2022-06-08 16:43:18 +12:00
Félix Saparelli
d59fd60e8a
Set MSRV
Not as policy, just because we use 1.61.0 features
2022-06-08 16:39:35 +12:00
Félix Saparelli
6333fb0bd3
Use newer format! syntax 2022-06-08 16:39:34 +12:00