Commit graph

26 commits

Author SHA1 Message Date
Jiahao XU
23bad39ba8
Refactor:Mv mod visitor vfs under crates_io
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-21 13:44:12 +10:00
Jiahao XU
b6f15f2e5e
Refactor: Extract fetch_crate_cratesio out into mod
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-21 13:42:39 +10:00
Jiahao XU
c916814e7e
Refactor: Extract find_version into mod
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-21 13:40:36 +10:00
Jiahao XU
53bf76104b
Revert refactor: Put fetch_crate_cratesio back to drivers
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-18 18:27:08 +10:00
Jiahao XU
b14b71135e
Revert refactor: Put find_version back to drivers
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-18 18:25:50 +10:00
Jiahao XU
e68eea35fe
Mark type ManifestVisitor as pub(super)
Since mod `cretesio` is the only one need to have access to it.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-12 16:40:51 +10:00
Jiahao XU
f3d3c488e3
Impl new type `ManifestVisitor
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-12 16:32:36 +10:00
Jiahao XU
3c30722a06
Impl new type Vfs which impl AbstractFilesystem
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-12 01:57:34 +10:00
Jiahao XU
6c6055da69
Refactor mod drivers: Extract out sub mods
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 22:43:45 +10:00
Jiahao XU
90a96cabc9
Rewrite untar to take a visitor & simplify
signature of `download_and_extract_with_filter`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 20:31:46 +10:00
Jiahao XU
b1b79921b2
Simplify download_and_extract_with_filter: Take TarBasedFmt
instead of `PkgFmt`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-11 20:15:17 +10:00
Jiahao XU
62be22256b
Refactor: Extract download_and_extract_with_filter
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 16:37:48 +10:00
Jiahao XU
1d139324c7
Rewrite untar: Takes a filter fn instead of array
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 16:35:51 +10:00
Jiahao XU
fb5f61559b
Fix use of download_and_extract in find_crate_cratesio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-10 15:50:56 +10:00
Jiahao XU
b6bfd40c3a
Use download_and_extract in fetch_crate_cratesio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-06-09 14:12:44 +10:00
Félix Saparelli
6333fb0bd3
Use newer format! syntax 2022-06-08 16:39:34 +12:00
Félix Saparelli
ac74da4a27
Clippy suggestions 2022-06-01 01:11:26 +12:00
Félix Saparelli
c0eaffb05d
Refactor for rich errors, split user abort and genuine error 2022-06-01 00:29:14 +12:00
Félix Saparelli
fbf26634c9
Formatting 2022-05-31 17:37:40 +12:00
Christof Weickhardt
256e695aa5 feat: remove crates-index dependency 2022-05-01 07:45:23 +00:00
Christof Weickhardt
5f9c673ea5 fix: ignore crate version if yanked 2022-04-29 11:10:05 +00:00
Félix Saparelli
370ae05620
QuickInstall support (#94)
See this issue: https://github.com/alsuren/cargo-quickinstall/issues/27

Quick Install is a hosted repo of built crates, essentially. The approach I've taken here is
a list of strategies:

1. First, we check the crate meta or default and build the URL to the repo. Once we have
   that, we perform a `HEAD` request to the URL to see if it's available.
2. If it's not, we build the URL to the quickinstall repo, and perform a `HEAD` to there.

As soon as we've got a hit, we use that. I've built it so it's extensible with more strategies.
This could be useful for #4.

This also adds a prompt before downloading from third-party sources, and logs a short
name for a source, which is easier to glance than a full URL, and includes a quick refactor
of the install/link machinery.
2022-02-16 14:49:07 +13:00
Félix Saparelli
0f9b4de449 Update deps 2021-11-17 21:53:20 +13:00
ryan
ef6a3d0ef7 fix version matching, now works with semver 2020-12-31 15:32:58 +13:00
ryan
223c6ef43a playing with version matching
Can't use semver because crates.io hides alpha versions? not sure how this works in cargo
2020-12-30 18:13:38 +13:00
ryan
8f7f7f5530 refactoring to library 2020-12-30 15:27:39 +13:00