Improve the name-version regex
authorLuca Barbato <lu_zero@gentoo.org>
Sat, 4 Apr 2020 15:21:41 +0000 (17:21 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 4 Apr 2020 15:42:39 +0000 (17:42 +0200)
See:
https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field

Unbreaks crates using `curl-sys` version `0.4.30+curl-7.69.1` and such.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
eclass/cargo.eclass

index 6776a4b03ac6423bc0ffa9844c43e55db415fda2..6f7ffdb626b4143730f56d4f0ea9005f4b6887d8 100644 (file)
@@ -39,7 +39,7 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
 # @DESCRIPTION:
 # Generates the URIs to put in SRC_URI to help fetch dependencies.
 cargo_crate_uris() {
-       local -r regex='^(.*)-([0-9]+\.[0-9]+\.[0-9]+.*)$'
+       local -r regex='^([a-zA-Z0-9_\-]+)-([0-9]+\.[0-9]+\.[0-9]+.*)$'
        local crate
        for crate in "$@"; do
                local name version url