aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Pizzamiglio <pizzamig@FreeBSD.org>2021-04-19 09:02:51 +0000
committerLuca Pizzamiglio <pizzamig@FreeBSD.org>2021-04-19 09:07:31 +0000
commit58744a09099a7accf9f5acd004e04701c6d8a130 (patch)
tree767c2bf531b3b5a94499761b154ae3cc4a82df3f
parent8719ffc8d55b58b61ffc7c7492742e383c62efe1 (diff)
downloadports-58744a09099a7accf9f5acd004e04701c6d8a130.tar.gz
ports-58744a09099a7accf9f5acd004e04701c6d8a130.zip
Uses/cargo: Improve URL subsitution for ports using CARGO_USE_GIT[HUB|LAB]
While maintaing a rust application, I found a cargo.toml that specifies the git URL with { git="https://..." }, cargo.mk expects a form like { git = "https://" }. This patch improve the regex making the spaces around the '=' optional Test: built all ports using the CARGO_USE_GIT feature Approved by: tobik Differential Revision: https://reviews.freebsd.org/D29805
-rw-r--r--Mk/Uses/cargo.mk8
1 files changed, 4 insertions, 4 deletions
diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index 816b720a2eef..e174dfa06d73 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -224,11 +224,11 @@ _CARGO_GIT_PATCH_CARGOTOML=
. for _group in ${GH_TUPLE:C@^[^:]*:[^:]*:[^:]*:(([^:/]*)?)((/.*)?)@\2@}
. if empty(CARGO_GIT_SUBDIR:M${_group}\:*)
_CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \
- -e "s@git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}\"@"
+ -e "s@git *= *['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}\"@"
. else
. for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g}
_CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \
- -e "/^${_crate} =/ s@git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}/${_subdir}\"@"
+ -e "/^${_crate} =/ s@git *= *['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}/${_subdir}\"@"
. endfor
. endif
. endfor
@@ -237,11 +237,11 @@ _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \
. for _group in ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\8@:S/^://}
. if empty(CARGO_GIT_SUBDIR:M${_group}\:*)
_CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \
- -e "s@git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}\"@"
+ -e "s@git *= *['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}\"@"
. else
. for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g}
_CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \
- -e "/^${_crate} = / s@git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}/${_subdir}\"@"
+ -e "/^${_crate} = / s@git *= *['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}/${_subdir}\"@"
. endfor
. endif
. endfor