diff options
author | Dirkjan Ochtman <djc@gentoo.org> | 2017-09-09 15:26:59 +0200 |
---|---|---|
committer | Dirkjan Ochtman <djc@gentoo.org> | 2017-09-09 15:26:59 +0200 |
commit | 22e6f49add5eb11715f230a50790c0eecf4f5f1f (patch) | |
tree | 7feee02f12d3c4414c4cc227bcab257c6f53cf1e /eclass | |
parent | dev-util/gource: version bump 0.47 (diff) | |
download | gentoo-22e6f49add5eb11715f230a50790c0eecf4f5f1f.tar.gz gentoo-22e6f49add5eb11715f230a50790c0eecf4f5f1f.tar.bz2 gentoo-22e6f49add5eb11715f230a50790c0eecf4f5f1f.zip |
eclass: improve cargo.eclass to better handle pre-release versions (fixes bug 630428)
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cargo.eclass | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index b08aa9e28aae..f805deba70c3 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -31,9 +31,14 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" cargo_crate_uris() { local crate for crate in "$@"; do - local name version url + local name version url pretag name="${crate%-*}" version="${crate##*-}" + pretag="[a-zA-Z]+" + if [[ $version =~ $pretag ]]; then + version="${name##*-}-${version}" + name="${name%-*}" + fi url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${crate}.crate" echo "${url}" done |