Skip to content

Commit

Permalink
eclass: improve cargo.eclass to better handle pre-release versions (f…
Browse files Browse the repository at this point in the history
…ixes bug 630428)
  • Loading branch information
djc committed Sep 9, 2017
1 parent 1917a29 commit 22e6f49
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eclass/cargo.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 22e6f49

Please sign in to comment.