From a71a39230be1908eb1f7a9bb9b91afd7d3cd15e3 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Mon, 14 Jul 2025 14:53:14 +0800 Subject: [PATCH] Using group name --- src/recipe/lang/Python/PDM.c | 4 ++-- src/recipe/lang/Python/Poetry.c | 4 ++-- src/recipe/lang/Python/Python.c | 18 +++++++++--------- src/recipe/lang/Python/Rye.c | 4 ++-- src/recipe/lang/Python/common.h | 4 ++-- src/recipe/lang/Python/pip.c | 4 ++-- src/recipe/lang/Python/uv.c | 4 ++-- src/recipe/menu.c | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/recipe/lang/Python/PDM.c b/src/recipe/lang/Python/PDM.c index d2ef39e..2a1d38d 100644 --- a/src/recipe/lang/Python/PDM.c +++ b/src/recipe/lang/Python/PDM.c @@ -28,7 +28,7 @@ pl_python_pdm_getsrc (char *option) void pl_python_pdm_setsrc (char *option) { - chsrc_yield_source (pl_python); + chsrc_yield_source (pl_python_group); if (chsrc_in_standalone_mode()) chsrc_confirm_source; @@ -82,4 +82,4 @@ pl_python_pdm_feat (char *option) } // def_target_gsrf(pl_python_pdm); -Target_t pl_python_pdm_target = {def_target_inner_gsrf(pl_python_pdm),def_target_sourcesn(pl_python)}; +Target_t pl_python_pdm_target = {def_target_inner_gsrf(pl_python_pdm),def_target_sourcesn(pl_python_group)}; diff --git a/src/recipe/lang/Python/Poetry.c b/src/recipe/lang/Python/Poetry.c index 68435b2..5268d12 100644 --- a/src/recipe/lang/Python/Poetry.c +++ b/src/recipe/lang/Python/Poetry.c @@ -27,7 +27,7 @@ pl_python_poetry_getsrc (char *option) void pl_python_poetry_setsrc (char *option) { - chsrc_yield_source (pl_python); + chsrc_yield_source (pl_python_group); if (chsrc_in_standalone_mode()) chsrc_confirm_source; @@ -78,4 +78,4 @@ pl_python_poetry_feat (char *option) } // def_target_gsrf(pl_python_poetry); -Target_t pl_python_poetry_target = {def_target_inner_gsrf(pl_python_poetry),def_target_sourcesn(pl_python)}; +Target_t pl_python_poetry_target = {def_target_inner_gsrf(pl_python_poetry),def_target_sourcesn(pl_python_group)}; diff --git a/src/recipe/lang/Python/Python.c b/src/recipe/lang/Python/Python.c index 61e4675..69b69ef 100644 --- a/src/recipe/lang/Python/Python.c +++ b/src/recipe/lang/Python/Python.c @@ -5,12 +5,12 @@ * Contributors : happy game * | * Created On : <2023-09-03> - * Last Modified : <2024-12-11> + * Last Modified : <2025-07-14> * * ------------------------------------------------------------*/ void -pl_python_getsrc (char *option) +pl_python_group_getsrc (char *option) { bool pdm_exist = false, poetry_exist = false, @@ -41,7 +41,7 @@ pl_python_getsrc (char *option) void -pl_python_setsrc (char *option) +pl_python_group_setsrc (char *option) { { char *msg = ENGLISH ? "Three package managers will be replaced for you at the same time: " @@ -58,7 +58,7 @@ pl_python_setsrc (char *option) pl_python_check_unofficial_pkger (&poetry_exist, &pdm_exist, &uv_exist); chsrc_set_target_group_mode (); - chsrc_yield_source_and_confirm (pl_python); + chsrc_yield_source_and_confirm (pl_python_group); // 交给后面检查命令的存在性 @@ -86,14 +86,14 @@ pl_python_setsrc (char *option) } void -pl_python_resetsrc (char *option) +pl_python_group_resetsrc (char *option) { - pl_python_setsrc (option); + pl_python_group_setsrc (option); } Feature_t -pl_python_feat (char *option) +pl_python_group_feat (char *option) { Feature_t f = {0}; @@ -101,11 +101,11 @@ pl_python_feat (char *option) f.can_reset = true; f.cap_locally = PartiallyCan; - f.cap_locally_explain = "Support `Poetry` & `PDM`, `uv`. No support for `pip`"; + f.cap_locally_explain = "Support Poetry, PDM, uv. No support for pip"; f.can_english = false; f.can_user_define = true; return f; } -def_target_gsrf(pl_python); +def_target_gsrf(pl_python_group); diff --git a/src/recipe/lang/Python/Rye.c b/src/recipe/lang/Python/Rye.c index eecfe2e..850c370 100644 --- a/src/recipe/lang/Python/Rye.c +++ b/src/recipe/lang/Python/Rye.c @@ -39,7 +39,7 @@ void pl_python_rye_setsrc (char *option) { /* 并不在 Python group 中,所以不考虑 target group 情况 */ - chsrc_yield_source_and_confirm (pl_python); + chsrc_yield_source_and_confirm (pl_python_group); const char *file = xy_strjoin (7, "[[sources]]\n", @@ -87,4 +87,4 @@ pl_python_rye_feat (char *option) } // def_target_gsrf(pl_python_rye); -Target_t pl_python_rye_target = {def_target_inner_gsrf(pl_python_rye),def_target_sourcesn(pl_python)}; +Target_t pl_python_rye_target = {def_target_inner_gsrf(pl_python_rye),def_target_sourcesn(pl_python_group)}; diff --git a/src/recipe/lang/Python/common.h b/src/recipe/lang/Python/common.h index bad10a6..f1f7bad 100644 --- a/src/recipe/lang/Python/common.h +++ b/src/recipe/lang/Python/common.h @@ -26,7 +26,7 @@ static SourceProvider_t pl_python_pypi_upstream = * @update 2025-07-11 * @note 不要添加Zju,浙大的PyPI服务在校外访问会自动转向Tuna */ -static Source_t pl_python_sources[] = +static Source_t pl_python_group_sources[] = { {&pl_python_pypi_upstream, "https://pypi.org/simple", DelegateToUpstream}, @@ -72,7 +72,7 @@ static Source_t pl_python_sources[] = /* 不启用原因:24小时更新一次 */ // {&Netease, "https://mirrors.163.com/.help/pypi.html", NULL} }; -def_sources_n(pl_python); +def_sources_n(pl_python_group); void pl_python_check_unofficial_pkger (bool *poetry_exist, bool *pdm_exist, bool *uv_exist) diff --git a/src/recipe/lang/Python/pip.c b/src/recipe/lang/Python/pip.c index d3a25ac..a5d8cf3 100644 --- a/src/recipe/lang/Python/pip.c +++ b/src/recipe/lang/Python/pip.c @@ -38,7 +38,7 @@ pl_python_pip_setsrc (char *option) return; } - chsrc_yield_source (pl_python); + chsrc_yield_source (pl_python_group); if (chsrc_in_standalone_mode()) chsrc_confirm_source; @@ -91,4 +91,4 @@ pl_python_pip_feat (char *option) } // def_target_gsrf(pl_python_pip); -Target_t pl_python_pip_target = {def_target_inner_gsrf(pl_python_pip),def_target_sourcesn(pl_python)}; +Target_t pl_python_pip_target = {def_target_inner_gsrf(pl_python_pip),def_target_sourcesn(pl_python_group)}; diff --git a/src/recipe/lang/Python/uv.c b/src/recipe/lang/Python/uv.c index 58b7184..e74d9fb 100644 --- a/src/recipe/lang/Python/uv.c +++ b/src/recipe/lang/Python/uv.c @@ -96,7 +96,7 @@ pl_python_uv_setsrc (char *option) { chsrc_ensure_program ("uv"); - chsrc_yield_source (pl_python); + chsrc_yield_source (pl_python_group); if (chsrc_in_standalone_mode()) chsrc_confirm_source; @@ -210,4 +210,4 @@ pl_python_uv_feat (char *option) } // def_target_gsrf(pl_python_uv); -Target_t pl_python_uv_target = {def_target_inner_gsrf(pl_python_uv),def_target_sourcesn(pl_python)}; +Target_t pl_python_uv_target = {def_target_inner_gsrf(pl_python_uv),def_target_sourcesn(pl_python_group)}; diff --git a/src/recipe/menu.c b/src/recipe/menu.c index 676cc84..5766c78 100644 --- a/src/recipe/menu.c +++ b/src/recipe/menu.c @@ -14,7 +14,7 @@ static const char *pl_ruby [] = {"gem", "ruby", "rb", "rubygem", "rubygems", "bundler", NULL, t(&pl_ruby_target)}, -*pl_python[] = {"python", "pypi", "py", NULL, t(&pl_python_target)}, +*pl_python[] = {"python", "pypi", "py", NULL, t(&pl_python_group_target)}, *pl_python_pip[] = {"pip", NULL, t(&pl_python_pip_target)}, *pl_python_poetry[] = {"poetry", NULL, t(&pl_python_poetry_target)}, *pl_python_pdm[] = {"pdm", NULL, t(&pl_python_pdm_target)},