git: 332722659b25 - 2021Q2 - Uses/cargo: Improve URL subsitution for ports using CARGO_USE_GIT[HUB|LAB]
Tobias Kortkamp
tobik at FreeBSD.org
Wed Apr 28 05:34:00 UTC 2021
The branch 2021Q2 has been updated by tobik:
URL: https://cgit.FreeBSD.org/ports/commit/?id=332722659b25d6c52e29bfbb3c81f5d2ffc9a62a
commit 332722659b25d6c52e29bfbb3c81f5d2ffc9a62a
Author: Luca Pizzamiglio <pizzamig at FreeBSD.org>
AuthorDate: 2021-04-19 09:02:51 +0000
Commit: Tobias Kortkamp <tobik at FreeBSD.org>
CommitDate: 2021-04-28 05:31:42 +0000
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
(cherry picked from commit 58744a09099a7accf9f5acd004e04701c6d8a130)
---
Mk/Uses/cargo.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index 36bf3c72c2d6..5014a1add25a 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 at git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}\"@"
+ -e "s at 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 at git = ['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}/${_subdir}\"@"
+ -e "/^${_crate} =/ s at 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 at git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}\"@"
+ -e "s at 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 at git = ['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}/${_subdir}\"@"
+ -e "/^${_crate} = / s at git *= *['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}/${_subdir}\"@"
. endfor
. endif
. endfor
More information about the dev-commits-ports-all
mailing list