Update pl recipes

This commit is contained in:
Aoran Zeng 2025-07-21 21:09:11 +08:00
parent 00f6deafb9
commit 7011fc1f79
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
5 changed files with 38 additions and 20 deletions

View File

@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com> * File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org> * Contributors : Nil Null <nil@null.org>
* Created On : <2023-09-10> * Created On : <2023-09-10>
* Last Modified : <2025-07-16> * Last Modified : <2025-07-21>
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
#include "rawstr4c.h" #include "rawstr4c.h"
@ -33,9 +33,13 @@ pl_haskell_setsrc (char *option)
{ {
chsrc_yield_source_and_confirm (pl_haskell); chsrc_yield_source_and_confirm (pl_haskell);
char *file = xy_strjoin (3, "repository mirror\n" char *file = R"(
" url: ", source.url, repository mirror
"\n secure: True"); url: @url@
secure: True
)";
file = xy_str_gsub (file, "@url@", source.url);
char *config = NULL; char *config = NULL;
if (xy_on_windows) if (xy_on_windows)
@ -48,7 +52,7 @@ pl_haskell_setsrc (char *option)
} }
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:")); chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
println (file); br(); println (file);
config = xy_normalize_path ("~/.stack/config.yaml"); config = xy_normalize_path ("~/.stack/config.yaml");
file = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url); file = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url);

View File

@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com> * File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Lontten <lontten@163.com> * Contributors : Lontten <lontten@163.com>
* Created On : <2024-09-29> * Created On : <2024-09-29>
* Last Modified : <2025-07-11> * Last Modified : <2025-07-21>
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
/** /**
@ -30,8 +30,13 @@ pl_nodejs_bun_setsrc (char *option)
// 用的是 npm Registry 的源 // 用的是 npm Registry 的源
chsrc_yield_source (pl_nodejs_group); chsrc_yield_source (pl_nodejs_group);
char *file = xy_strjoin(3, "[install]\n" char *file =
"registry = \"", source.url, "\""); R"(
[install]
registry = "@url@"
)";
file = xy_str_gsub (file, "@url@", source.url);
if (chsrc_in_local_mode()) if (chsrc_in_local_mode())
{ {

View File

@ -4,7 +4,7 @@
* File Authors : Aoran Zeng <ccmywish@qq.com> * File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nul None <nul@none.org> * Contributors : Nul None <nul@none.org>
* Created On : <2024-12-06> * Created On : <2024-12-06>
* Last Modified : <2025-07-11> * Last Modified : <2025-07-21>
* *
* Rye已经有后继uv了Python group中 * Rye已经有后继uv了Python group中
* ------------------------------------------------------------*/ * ------------------------------------------------------------*/
@ -41,10 +41,15 @@ pl_python_rye_setsrc (char *option)
/* 并不在 Python group 中,所以不考虑 target group 情况 */ /* 并不在 Python group 中,所以不考虑 target group 情况 */
chsrc_yield_source_and_confirm (pl_python_group); chsrc_yield_source_and_confirm (pl_python_group);
const char *file = xy_strjoin (7, const char *file =
"[[sources]]\n", R"(
"name = \"", source.mirror->abbr, "\"\n", [[sources]]
"url = \"", source.url, "\""); name = "@1@"
url = "@2@"
)";
file = xy_str_gsub (file, "@1@", source.mirror->abbr);
file = xy_str_gsub (file, "@2@", source.url);
char *rye_config = pl_python_find_rye_config (); char *rye_config = pl_python_find_rye_config ();
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:")); chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:"));

View File

@ -84,15 +84,19 @@ pl_rust_cargo_setsrc (char *option)
{ {
chsrc_yield_source_and_confirm (pl_rust_cargo); chsrc_yield_source_and_confirm (pl_rust_cargo);
const char* file = xy_strjoin (3, const char *file =
"[source.crates-io]\n" R"toml(
"replace-with = 'mirror'\n\n" [source.crates-io]
replace-with = 'mirror'
"[source.mirror]\n" [source.mirror]
"registry = \"sparse+", source.url, "\""); registry = "sparse+@url@"
)toml";
file = xy_str_gsub (file, "@url@", source.url);
chsrc_note2 (xy_strjoin (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:")); chsrc_note2 (xy_strjoin (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:"));
p(file); println (file);
chsrc_determine_chgtype (ChgType_Auto); chsrc_determine_chgtype (ChgType_Auto);
chsrc_conclude (&source); chsrc_conclude (&source);