aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2020-03-23 03:57:26 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2020-03-23 03:57:26 +0000
commit5d337babdf83828dca4a8b8a591d96020463208e (patch)
tree29491a3c6c9b4adace2465571f1f0cdc5b743331 /Mk
parentac89e64a0780b8f1fff05532a8429d3663ee4e60 (diff)
downloadports-5d337babdf83828dca4a8b8a591d96020463208e.tar.gz
ports-5d337babdf83828dca4a8b8a591d96020463208e.zip
Mk/Uses/cargo.mk: Better deal with versions with build identifier suffixes
A crate spec like curl-sys-0.4.30+curl-7.69.1 was incorrectly interpreted as having a name of 'curl-sys-0.4.30+curl' instead of 'curl-sys' and failed to fetch as a consequence. Crate names can only be composed of a limited character set [1]. Limit the regular expressions to that set and make them less greedy. [1] https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field PR: 244977 Reported by: jbeich
Notes
Notes: svn path=/head/; revision=528945
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/cargo.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index e30d07ce0fe4..56f352b93feb 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -37,7 +37,7 @@ CARGO_DIST_SUBDIR?= rust/crates
# Generate list of DISTFILES.
.for _crate in ${CARGO_CRATES}
-MASTER_SITES+= CRATESIO/${_crate:C/^(.*)-[0-9].*/\1/}/${_crate:C/^.*-([0-9].*)/\1/}:cargo_${_crate:C/[^a-zA-Z0-9_]//g}
+MASTER_SITES+= CRATESIO/${_crate:C/^([-_a-zA-Z0-9]+)-[0-9].*/\1/}/${_crate:C/^[-_a-zA-Z0-9]+-([0-9].*)/\1/}:cargo_${_crate:C/[^a-zA-Z0-9_]//g}
DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:C/[^a-zA-Z0-9_]//g}
.endfor