1 |
commit: 22e6f49add5eb11715f230a50790c0eecf4f5f1f |
2 |
Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 9 13:26:59 2017 +0000 |
4 |
Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 9 13:26:59 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22e6f49a |
7 |
|
8 |
eclass: improve cargo.eclass to better handle pre-release versions (fixes bug 630428) |
9 |
|
10 |
eclass/cargo.eclass | 7 ++++++- |
11 |
1 file changed, 6 insertions(+), 1 deletion(-) |
12 |
|
13 |
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass |
14 |
index b08aa9e28aa..f805deba70c 100644 |
15 |
--- a/eclass/cargo.eclass |
16 |
+++ b/eclass/cargo.eclass |
17 |
@@ -31,9 +31,14 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" |
18 |
cargo_crate_uris() { |
19 |
local crate |
20 |
for crate in "$@"; do |
21 |
- local name version url |
22 |
+ local name version url pretag |
23 |
name="${crate%-*}" |
24 |
version="${crate##*-}" |
25 |
+ pretag="[a-zA-Z]+" |
26 |
+ if [[ $version =~ $pretag ]]; then |
27 |
+ version="${name##*-}-${version}" |
28 |
+ name="${name%-*}" |
29 |
+ fi |
30 |
url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${crate}.crate" |
31 |
echo "${url}" |
32 |
done |