Merge branch 'dev' into dev

This commit is contained in:
冰彦糖
2025-08-23 13:58:54 +08:00
committed by GitHub
98 changed files with 2307 additions and 1536 deletions

View File

@@ -7,24 +7,22 @@ def_target(pl_clojure, "clojure/clojars/cloj/lein");
void
pl_clojure_prelude ()
{
use_this(pl_clojure);
chef_allow_s(pl_clojure);
chef_prep_this (pl_clojure, s);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-14");
chef_set_sources_last_updated (this, "2025-08-21");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_forbid_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, NULL, DelegateToUpstream},
{&UpstreamProvider,"https://repo.clojars.org/", DelegateToUpstream},
{&MirrorZ, "https://mirrors.cernet.edu.cn/clojars/", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/clojars/", DelegateToMirror},
{&Nju, "https://mirror.nju.edu.cn/clojars/", DelegateToMirror},
@@ -38,7 +36,7 @@ pl_clojure_prelude ()
void
pl_clojure_setsrc (char *option)
{
use_this_source(pl_clojure);
chsrc_use_this_source (pl_clojure);
if (chsrc_in_local_mode())
{

View File

@@ -7,19 +7,15 @@ def_target(pl_dart_flutter, "flutter");
void
pl_dart_flutter_prelude (void)
{
use_this(pl_dart_flutter);
chef_allow_gsr(pl_dart_flutter);
chef_prep_this (pl_dart_flutter, gsr);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-04-15");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"czyt", "czyt.go@gmail.com",
"MadDogOwner", "xiaoran@xrgzs.top");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@czyt", "@xrgzs");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
@@ -55,13 +51,13 @@ pl_dart_flutter_getsrc (char *option)
void
pl_dart_flutter_setsrc (char *option)
{
use_this_source(pl_dart_flutter);
chsrc_use_this_source (pl_dart_flutter);
char *w = NULL;
char *cmd = NULL;
if (xy_on_windows)
{
cmd = xy_strjoin (3, "setx FLUTTER_STORAGE_BASE_URL \"", source.url, "\"");
cmd = xy_strcat (3, "setx FLUTTER_STORAGE_BASE_URL \"", source.url, "\"");
chsrc_run (cmd, RunOpt_No_Last_New_Line);
}
else
@@ -70,7 +66,7 @@ pl_dart_flutter_setsrc (char *option)
char *bashrc = xy_bashrc;
chsrc_backup (zshrc);
w = xy_strjoin (3, "export FLUTTER_STORAGE_BASE_URL=\"", source.url, "\"\n");
w = xy_strcat (3, "export FLUTTER_STORAGE_BASE_URL=\"", source.url, "\"\n");
chsrc_append_to_file (w, zshrc);
if (xy_file_exist (bashrc))

View File

@@ -7,19 +7,15 @@ def_target(pl_dart, "dart/pub");
void
pl_dart_prelude (void)
{
use_this(pl_dart);
chef_allow_gsr(pl_dart);
chef_prep_this (pl_dart, gsr);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-04-15");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"czyt", "czyt.go@gmail.com",
"MadDogOwner", "xiaoran@xrgzs.top");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@czyt", "@xrgzs");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
@@ -51,13 +47,13 @@ pl_dart_getsrc (char *option)
void
pl_dart_setsrc (char *option)
{
use_this_source(pl_dart);
chsrc_use_this_source (pl_dart);
char *w = NULL;
char *cmd = NULL;
if (xy_on_windows)
{
cmd = xy_strjoin (3, "setx PUB_HOSTED_URL \"", source.url, "\"");
cmd = xy_strcat (3, "setx PUB_HOSTED_URL \"", source.url, "\"");
chsrc_run (cmd, RunOpt_No_Last_New_Line);
}
else
@@ -66,7 +62,7 @@ pl_dart_setsrc (char *option)
char *bashrc = xy_bashrc;
chsrc_backup (zshrc);
w = xy_strjoin (3, "export PUB_HOSTED_URL=\"", source.url, "\"\n");
w = xy_strcat (3, "export PUB_HOSTED_URL=\"", source.url, "\"\n");
chsrc_append_to_file (w, zshrc);

View File

@@ -21,19 +21,15 @@ def_target(pl_go, "go/golang/goproxy");
void
pl_go_prelude ()
{
use_this(pl_go);
chef_allow_gsr(pl_go);
chef_prep_this (pl_go, gsr);
chef_set_created_on (this, "2023-08-30");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-12");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"czyt", "czyt.go@gmail.com",
"Rui Yang", "techoc@foxmail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@czyt", "@techoc");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -84,12 +80,12 @@ pl_go_setsrc (char *option)
{
pl_go_check_cmd ();
use_this_source(pl_go);
chsrc_use_this_source (pl_go);
char *cmd = "go env -w GO111MODULE=on";
chsrc_run (cmd, RunOpt_Default);
cmd = xy_strjoin (3, "go env -w GOPROXY=", source.url, ",direct");
cmd = xy_strcat (3, "go env -w GOPROXY=", source.url, ",direct");
chsrc_run (cmd, RunOpt_Default);
chsrc_conclude (&source);

View File

@@ -7,24 +7,22 @@ def_target(pl_haskell, "haskell/cabal/stack/hackage");
void
pl_haskell_prelude ()
{
use_this(pl_haskell);
chef_allow_s(pl_haskell);
chef_prep_this (pl_haskell, s);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2023-09-10");
chef_set_sources_last_updated (this, "2025-08-22");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, NULL, DelegateToUpstream},
{&UpstreamProvider, "https://hackage.haskell.org", DelegateToUpstream},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/hackage", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/hackage", DelegateToMirror},
{&Nju, "https://mirror.nju.edu.cn/hackage", DelegateToMirror},
@@ -41,7 +39,7 @@ pl_haskell_prelude ()
void
pl_haskell_setsrc (char *option)
{
use_this_source(pl_haskell);
chsrc_use_this_source (pl_haskell);
char *content = xy_str_gsub (RAWSTR_pl_haskell_cabal_config, "@url@", source.url);
@@ -55,12 +53,12 @@ pl_haskell_setsrc (char *option)
config = "~/.cabal/config";
}
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
chsrc_note2 (xy_strcat (3, "请向 ", config, " 中手动添加:"));
println (content);
config = xy_normalize_path ("~/.stack/config.yaml");
content = xy_str_gsub (RAWSTR_pl_haskell_stackage_yaml, "@url@", source.url);
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
chsrc_note2 (xy_strcat (3, "请向 ", config, " 中手动添加:"));
println (content);
chsrc_conclude (&source);

View File

@@ -7,18 +7,15 @@ def_target(pl_java, "java/maven/mvn/maven-daemon/mvnd/gradle");
void
pl_java_prelude ()
{
use_this(pl_java);
chef_allow_gsr(pl_java);
chef_prep_this (pl_java, gsr);
chef_set_created_on (this, "2023-08-31");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-12-18");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"BingChunMoLi", "bingchunmoli@bingchunmoli.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@BingChunMoLi");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -85,7 +82,6 @@ pl_java_find_maven_config ()
return "~/.m2/settings.xml";
}
char *
pl_java_find_maven_daemon_config ()
{
@@ -114,12 +110,12 @@ pl_java_getsrc (char *option)
if (maven_exist)
{
char *maven_config = pl_java_find_maven_config ();
chsrc_note2 (xy_2strjoin ("请查看 ", maven_config));
chsrc_note2 (xy_2strcat ("请查看 ", maven_config));
}
if(maven_daemon_exist)
{
char *maven_config = pl_java_find_maven_daemon_config ();
chsrc_note2 (xy_2strjoin ("请查看 ", maven_config));
chsrc_note2 (xy_2strcat ("请查看 ", maven_config));
}
}
@@ -137,7 +133,7 @@ pl_java_setsrc (char *option)
bool maven_exist, gradle_exist, maven_daemon_exist;
pl_java_check_cmd (&maven_exist, &gradle_exist, &maven_daemon_exist);
use_this_source(pl_java);
chsrc_use_this_source(pl_java);
use_custom_user_agent();
if (maven_exist)
{
@@ -145,7 +141,7 @@ pl_java_setsrc (char *option)
file = xy_str_gsub (file, "@name@", source.mirror->name);
file = xy_str_gsub (file, "@url@", source.url);
char *maven_config = pl_java_find_maven_config ();
chsrc_note2 (xy_strjoin (3, "请在 maven 配置文件 ", maven_config, " 中添加:"));
chsrc_note2 (xy_strcat (3, "请在 maven 配置文件 ", maven_config, " 中添加:"));
println (file);
}

View File

@@ -7,26 +7,21 @@ def_target(pl_js_bun, "bun");
void
pl_js_bun_prelude (void)
{
use_this(pl_js_bun);
chef_allow_gsr(pl_js_bun);
chef_prep_this (pl_js_bun, gsr);
chef_set_created_on (this, "2024-09-29");
chef_set_last_updated (this, "2025-07-22");
chef_set_sources_last_updated (this, "2025-07-22");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Lontten", "lontten@163.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@lontten");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 用的是 npm Registry 的源,所以使用 pl_js_group 的源
this->sources = pl_js_group_target.sources;
this->sources_n = pl_js_group_target.sources_n;
chef_use_other_target_sources (this, &pl_js_group_target);
}
/**
@@ -62,7 +57,7 @@ pl_js_bun_setsrc (char *option)
}
else
{
chsrc_note2 (xy_strjoin (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.bunfig.toml"), " 文件中"));
chsrc_note2 (xy_strcat (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.bunfig.toml"), " 文件中"));
}
println (content);

View File

@@ -70,8 +70,7 @@ pl_js_group_setsrc (char *option)
chsrc_set_target_group_mode ();
use_this(pl_js_group);
Source_t source = chsrc_yield_source_and_confirm (this, option);
chsrc_use_this_source (pl_js_group);
if (npm_exist)
{

View File

@@ -7,26 +7,21 @@ def_target(pl_js_yarn, "yarn");
void
pl_js_yarn_prelude (void)
{
use_this(pl_js_yarn);
chef_allow_gsr(pl_js_yarn);
chef_prep_this (pl_js_yarn, gsr);
chef_set_created_on (this, "2023-09-09");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Mr. Will", "mr.will.com@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@MrWillCom");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_js_group 的源
this->sources = pl_js_group_target.sources;
this->sources_n = pl_js_group_target.sources_n;
chef_use_other_target_sources (this, &pl_js_group_target);
}
static double
@@ -68,9 +63,9 @@ pl_js_yarn_setsrc (char *option)
if (pl_js_yarn_get_yarn_version () >= 2)
{
if (chsrc_in_local_mode()) // Yarn 默认情况下就是基于本项目换源
cmd = xy_2strjoin ("yarn config set npmRegistryServer ", source.url);
cmd = xy_2strcat ("yarn config set npmRegistryServer ", source.url);
else
cmd = xy_2strjoin ("yarn config set npmRegistryServer --home ", source.url);
cmd = xy_2strcat ("yarn config set npmRegistryServer --home ", source.url);
chsrc_run (cmd, RunOpt_No_Last_New_Line);
}
@@ -84,7 +79,7 @@ pl_js_yarn_setsrc (char *option)
return;
}
// 不再阻止换源命令输出到终端,即不再调用 xy_str_to_quietcmd()
cmd = xy_2strjoin ("yarn config set registry ", source.url);
cmd = xy_2strcat ("yarn config set registry ", source.url);
chsrc_run (cmd, RunOpt_No_Last_New_Line);
}

View File

@@ -14,17 +14,16 @@ def_target(pl_js_group, "js/javascript/node/nodejs");
void
pl_js_group_prelude (void)
{
use_this(pl_js_group);
chef_allow_gsr(pl_js_group);
chef_prep_this (pl_js_group, gsr);
chef_set_created_on (this, "2023-09-09");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 1, "happy game", "happygame1024@gmail.com");
chef_set_contributors (this,0);
chef_set_chef (this, "@happy-game");
// 组换源的 leader target 应把所有 follower target 的贡献者都记录过来
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@lontten", "@MrWillCom");
chef_allow_local_mode (this, PartiallyCan,
"支持 npm, yarn v2, pnpm, 不支持 yarn v1",
@@ -45,22 +44,20 @@ pl_js_group_prelude (void)
def_target(pl_js_nodejs_binary, "__internal_use_nodejs_binary__");
def_target(pl_js_nodejs_binary, "__internal_target_nodejs_binary__");
void
pl_js_nodejs_binary_prelude (void)
{
use_this(pl_js_nodejs_binary);
chef_allow_gsr(pl_js_group);
chef_prep_this (pl_js_nodejs_binary, NOOP);
chef_set_created_on (this, "2023-09-09");
chef_set_last_updated (this, "2025-07-11");
chef_set_last_updated (this, "2025-08-22");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);

View File

@@ -7,26 +7,21 @@ def_target(pl_js_npm, "npm");
void
pl_js_npm_prelude (void)
{
use_this(pl_js_npm);
chef_allow_gsr(pl_js_npm);
chef_prep_this (pl_js_npm, gsr);
chef_set_created_on (this, "2023-08-30");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Mr. Will", "mr.will.com@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@MrWillCom");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_js_group 的源
this->sources = pl_js_group_target.sources;
this->sources_n = pl_js_group_target.sources_n;
chef_use_other_target_sources (this, &pl_js_group_target);
}
@@ -50,9 +45,9 @@ pl_js_npm_setsrc (char *option)
char *cmd = NULL;
if (chsrc_in_local_mode())
cmd = xy_2strjoin ("npm config --location project set registry ", source.url);
cmd = xy_2strcat ("npm config --location project set registry ", source.url);
else
cmd = xy_2strjoin ("npm config set registry ", source.url);
cmd = xy_2strcat ("npm config set registry ", source.url);
chsrc_run (cmd, RunOpt_No_Last_New_Line);

View File

@@ -7,17 +7,15 @@ def_target(pl_js_nvm, "nvm");
void
pl_js_nvm_prelude (void)
{
use_this(pl_js_nvm);
chef_allow_gsr(pl_js_nvm);
chef_prep_this (pl_js_nvm, gsr);
chef_set_created_on (this, "2024-09-23");
chef_set_last_updated (this, "2025-06-19");
chef_set_sources_last_updated (this, "2025-06-19");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
@@ -25,9 +23,7 @@ pl_js_nvm_prelude (void)
chef_set_note (this, "nvm 不支持 Fish shell", "nvm does not support Fish");
// 使用 pl_js_nodejs_binary 的源
this->sources = pl_js_nodejs_binary_target.sources;
this->sources_n = pl_js_nodejs_binary_target.sources_n;
chef_use_other_target_sources (this, &pl_js_nodejs_binary_target);
}
@@ -50,7 +46,7 @@ pl_js_nvm_setsrc (char *option)
{
Source_t source = chsrc_yield_source_and_confirm (&pl_js_nodejs_binary_target, option);
char *w = xy_strjoin (3, "export NVM_NODEJS_ORG_MIRROR=", source.url, "\n");
char *w = xy_strcat (3, "export NVM_NODEJS_ORG_MIRROR=", source.url, "\n");
char *zshrc = xy_zshrc;
char *bashrc = xy_bashrc;

View File

@@ -7,25 +7,21 @@ def_target(pl_js_pnpm, "pnpm");
void
pl_js_pnpm_prelude (void)
{
use_this(pl_js_pnpm);
chef_allow_gsr(pl_js_pnpm);
chef_prep_this (pl_js_pnpm, gsr);
chef_set_created_on (this, "2024-04-18");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_js_group 的源
this->sources = pl_js_group_target.sources;
this->sources_n = pl_js_group_target.sources_n;
chef_use_other_target_sources (this, &pl_js_group_target);
}
@@ -50,9 +46,9 @@ pl_js_pnpm_setsrc (char *option)
char *cmd = NULL;
if (chsrc_in_local_mode())
cmd = xy_2strjoin ("pnpm config --location project set registry ", source.url);
cmd = xy_2strcat ("pnpm config --location project set registry ", source.url);
else
cmd = xy_2strjoin ("pnpm config -g set registry ", source.url);
cmd = xy_2strcat ("pnpm config -g set registry ", source.url);
chsrc_run (cmd, RunOpt_No_Last_New_Line);

View File

@@ -7,24 +7,22 @@ def_target(pl_julia, "julia");
void
pl_julia_prelude ()
{
use_this(pl_julia);
chef_allow_gs(pl_julia);
chef_prep_this (pl_julia, gs);
chef_set_created_on (this, "2023-08-31");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-14");
chef_set_sources_last_updated (this, "2025-08-22");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, NULL, DelegateToUpstream},
{&UpstreamProvider, "https://pkg.julialang.org", DelegateToUpstream},
{&Pku, "https://mirrors.pku.edu.cn/julia", DelegateToMirror},
{&Nju, "https://mirror.nju.edu.cn/julia", DelegateToMirror},
{&Iscas, "https://mirror.iscas.ac.cn/julia", DelegateToMirror}
@@ -54,9 +52,9 @@ pl_julia_getsrc (char *option)
void
pl_julia_setsrc (char *option)
{
use_this_source(pl_julia);
chsrc_use_this_source (pl_julia);
char *w = xy_strjoin (3, "ENV[\"JULIA_PKG_SERVER\"] = \"", source.url, "\"");
char *w = xy_strcat (3, "ENV[\"JULIA_PKG_SERVER\"] = \"", source.url, "\"");
chsrc_append_to_file (w, PL_Julia_Config);

View File

@@ -14,24 +14,22 @@ def_target(pl_lua, "lua/luarocks");
void
pl_lua_prelude ()
{
use_this(pl_lua);
chef_allow_gs(pl_lua);
chef_prep_this (pl_lua, gs);
chef_set_created_on (this, "2023-09-27");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-14");
chef_set_sources_last_updated (this, "2025-08-22");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, NULL, DelegateToUpstream},
{&UpstreamProvider, "https://luarocks.org", DelegateToUpstream},
{&Api7, "https://luarocks.cn", DelegateToMirror}
def_sources_end()
}
@@ -50,17 +48,16 @@ pl_lua_getsrc (char *option)
void
pl_lua_setsrc (char *option)
{
use_this(pl_lua);
Source_t source = chsrc_yield_source_and_confirm (this, option);
chsrc_use_this_source (pl_lua);
char *config = xy_strjoin (3, "rocks_servers = {\n"
char *config = xy_strcat (3, "rocks_servers = {\n"
" \"", source.url, "\"\n"
"}");
chsrc_note2 ("请手动修改 ~/.luarocks/config.lua 文件 (用于下载):");
println (config);
char *upload_config = xy_strjoin (3, "key = \"<Your API Key>\"\n"
char *upload_config = xy_strcat (3, "key = \"<Your API Key>\"\n"
"server = \"", source.url, "\"");
chsrc_note2 ("请手动修改 ~/.luarocks/upload_config.lua 文件 (用于上传):");

View File

@@ -7,17 +7,15 @@ def_target(pl_nuget, "nuget/net/.net/dotnet");
void
pl_nuget_prelude ()
{
use_this(pl_nuget);
chef_allow_gs(pl_nuget);
chef_prep_this (pl_nuget, gs);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-04-18");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);

View File

@@ -7,17 +7,15 @@ def_target(pl_ocaml, "ocaml/opam");
void
pl_ocaml_prelude ()
{
use_this(pl_ocaml);
chef_allow_gs(pl_ocaml);
chef_prep_this (pl_ocaml, gs);
chef_set_created_on (this, "2023-09-15");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-14");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -53,16 +51,16 @@ pl_ocaml_setsrc (char *option)
{
pl_ocaml_check_cmd ();
use_this_source(pl_ocaml);
chsrc_use_this_source (pl_ocaml);
char *cmd = xy_strjoin (3, "opam repo set-url default ",
char *cmd = xy_strcat (3, "opam repo set-url default ",
source.url,
" --all --set-default");
chsrc_run (cmd, RunOpt_Default);
chsrc_alert2 ("如果是首次使用 opam ,请使用以下命令进行初始化");
println (xy_2strjoin ("opam init default ", source.url));
println (xy_2strcat ("opam init default ", source.url));
chsrc_conclude (&source);
}

View File

@@ -7,17 +7,15 @@ def_target(pl_php, "php/composer");
void
pl_php_prelude ()
{
use_this(pl_php);
chef_allow_gs(pl_php);
chef_prep_this (pl_php, gs);
chef_set_created_on (this, "2023-08-30");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-09-14");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_forbid_english(this);
@@ -57,8 +55,7 @@ pl_php_setsrc (char *option)
{
pl_php_check_cmd ();
use_this(pl_php);
Source_t source = chsrc_yield_source_and_confirm (this, option);
chsrc_use_this_source (pl_php);
char *where = " -g ";
if (chsrc_in_local_mode())
@@ -66,7 +63,7 @@ pl_php_setsrc (char *option)
where = " ";
}
char *cmd = xy_strjoin (4, "composer config", where, "repo.packagist composer ", source.url);
char *cmd = xy_strcat (4, "composer config", where, "repo.packagist composer ", source.url);
chsrc_run (cmd, RunOpt_Default);
chsrc_conclude (&source);

View File

@@ -7,24 +7,22 @@ def_target(pl_perl, "perl/cpan");
void
pl_perl_prelude ()
{
use_this(pl_perl);
chef_allow_gs(pl_perl);
chef_prep_this (pl_perl, gs);
chef_set_created_on (this, "2023-09-31");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-05-24");
chef_set_sources_last_updated (this, "2025-08-21");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_allow_user_define(this);
def_sources_begin()
{&UpstreamProvider, NULL, DelegateToUpstream},
{&UpstreamProvider, "https://www.cpan.org/", DelegateToUpstream},
{&Bfsu, "https://mirrors.bfsu.edu.cn/CPAN/", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CPAN/", DelegateToMirror},
{&Bjtu, "https://mirror.bjtu.edu.cn/cpan/", DelegateToMirror},
@@ -59,9 +57,9 @@ pl_perl_getsrc (char *option)
void
pl_perl_setsrc (char *option)
{
use_this_source(pl_perl);
chsrc_use_this_source (pl_perl);
char *cmd = xy_strjoin (3,
char *cmd = xy_strcat (3,
"perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('urllist', 'unshift', '", source.url, "'); CPAN::HandleConfig->commit()\"");
chsrc_run (cmd, RunOpt_Default);

View File

@@ -7,25 +7,21 @@ def_target(pl_python_pdm, "pdm");
void
pl_python_pdm_prelude (void)
{
use_this(pl_python_pdm);
chef_allow_gsr(pl_python_pdm);
chef_prep_this (pl_python_pdm, gsr);
chef_set_created_on (this, "2024-06-05");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, FullyCan, "支持项目级配置", "Supports project-level configuration");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_python_group 的源
this->sources = pl_python_group_target.sources;
this->sources_n = pl_python_group_target.sources_n;
chef_use_other_target_sources (this, &pl_python_group_target);
}
@@ -52,9 +48,9 @@ pl_python_pdm_setsrc (char *option)
char *cmd = NULL;
if (chsrc_in_local_mode())
cmd = xy_2strjoin ("pdm config --local pypi.url ", source.url);
cmd = xy_2strcat ("pdm config --local pypi.url ", source.url);
else
cmd = xy_2strjoin ("pdm config --global pypi.url ", source.url);
cmd = xy_2strcat ("pdm config --global pypi.url ", source.url);
chsrc_run (cmd, RunOpt_No_Last_New_Line);

View File

@@ -7,25 +7,21 @@ def_target(pl_python_poetry, "poetry");
void
pl_python_poetry_prelude (void)
{
use_this(pl_python_poetry);
chef_allow_gsr(pl_python_poetry);
chef_prep_this (pl_python_poetry, gsr);
chef_set_created_on (this, "2024-08-08");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, FullyCan, "Poetry 默认使用项目级换源", "Poetry uses project-level source changing by default");
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_python_group 的源
this->sources = pl_python_group_target.sources;
this->sources_n = pl_python_group_target.sources_n;
chef_use_other_target_sources (this, &pl_python_group_target);
}
void
@@ -50,7 +46,7 @@ pl_python_poetry_setsrc (char *option)
if (!chsrc_in_local_mode())
chsrc_alert2 ("Poetry 仅支持项目级换源");
cmd = xy_2strjoin ("poetry source add my_mirror ", source.url);
cmd = xy_2strcat ("poetry source add my_mirror ", source.url);
chsrc_run (cmd, RunOpt_No_Last_New_Line);
if (chsrc_in_standalone_mode())

View File

@@ -58,8 +58,7 @@ pl_python_group_setsrc (char *option)
chsrc_set_target_group_mode ();
use_this(pl_python_group);
Source_t source = chsrc_yield_source_and_confirm (this, option);
chsrc_use_this_source (pl_python_group);
// 交给后面检查命令的存在性

View File

@@ -9,25 +9,21 @@ def_target(pl_python_rye, "rye");
void
pl_python_rye_prelude (void)
{
use_this(pl_python_rye);
chef_allow_gsr(pl_python_rye);
chef_prep_this (pl_python_rye, gsr);
chef_set_created_on (this, "2024-12-06");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-08-09");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, FullyCan, "支持项目级配置", "Supports project-level configuration");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_python_group 的源
this->sources = pl_python_group_target.sources;
this->sources_n = pl_python_group_target.sources_n;
chef_use_other_target_sources (this, &pl_python_group_target);
}
char *
@@ -45,7 +41,7 @@ void
pl_python_rye_getsrc (char *option)
{
char *rye_config = pl_python_find_rye_config ();
chsrc_note2 (xy_strjoin (3, "请查看 ", rye_config, " 配置文件中的 [[sources]] 节内容"));
chsrc_note2 (xy_strcat (3, "请查看 ", rye_config, " 配置文件中的 [[sources]] 节内容"));
}
@@ -64,7 +60,7 @@ pl_python_rye_setsrc (char *option)
content = xy_str_gsub (content, "@2@", source.url);
char *rye_config = pl_python_find_rye_config ();
chsrc_note2 (xy_strjoin (3, "请在配置文件 ", rye_config, " 中添加:"));
chsrc_note2 (xy_strcat (3, "请在配置文件 ", rye_config, " 中添加:"));
println (content);
chsrc_determine_chgtype (ChgType_Manual);

View File

@@ -14,7 +14,7 @@ static char *
pl_python_speed_url_constructor (const char *url, const char *user_data)
{
char *str = xy_str_delete_suffix (url, "/simple");
str = xy_2strjoin (str, "/packages/56/e4/55aaac2b15af4dad079e5af329a79d961e5206589d0e02b1e8da221472ed/tensorflow-2.18.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl");
str = xy_2strcat (str, "/packages/56/e4/55aaac2b15af4dad079e5af329a79d961e5206589d0e02b1e8da221472ed/tensorflow-2.18.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl");
return str;
}
@@ -22,19 +22,16 @@ pl_python_speed_url_constructor (const char *url, const char *user_data)
void
pl_python_group_prelude (void)
{
use_this(pl_python_group);
chef_allow_gsr(pl_python_group);
chef_prep_this (pl_python_group, gsr);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-07-14");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 1, "happy game", "happygame1024@gmail.com");
chef_set_contributors (this, 1,
"yongxiang", "1926885268@qq.com");
chef_set_chef (this, "@happy-game");
// 组换源的 leader target 应把所有 follower target 的贡献者都记录过来
chef_set_cooks (this, 2, "@ccmywish", "@happy-game");
chef_set_sauciers (this, 2, "@xyx1926885268", "@Kattos");
chef_allow_local_mode (this, PartiallyCan, "部分包管理器支持项目级换源", "Some package managers support project-level source changing");
chef_allow_english(this);
@@ -76,7 +73,7 @@ pl_python_check_unofficial_pkger (bool *poetry_exist, bool *pdm_exist, bool *uv_
/**
* @param[out] prog 返回 Python 的可用名,如果不可用,则返回 NULL
* @param[out] prog_name 返回 Python 的可用名,如果不可用,则返回 NULL
*/
void
pl_python_get_py_program_name (char **prog_name)

View File

@@ -7,25 +7,21 @@ def_target(pl_python_pip, "pip");
void
pl_python_pip_prelude (void)
{
use_this(pl_python_pip);
chef_allow_gsr(pl_python_pip);
chef_prep_this (pl_python_pip, gsr);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-07-11");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_python_group 的源
this->sources = pl_python_group_target.sources;
this->sources_n = pl_python_group_target.sources_n;
chef_use_other_target_sources (this, &pl_python_group_target);
}
@@ -35,7 +31,7 @@ pl_python_pip_getsrc (char *option)
char *py_prog_name = NULL;
pl_python_get_py_program_name (&py_prog_name);
char *cmd = xy_2strjoin (py_prog_name, " -m pip config get global.index-url");
char *cmd = xy_2strcat (py_prog_name, " -m pip config get global.index-url");
chsrc_run (cmd, RunOpt_Default);
}
@@ -65,7 +61,7 @@ pl_python_pip_setsrc (char *option)
// 这里用的是 config --user会写入用户目录而不是项目目录
// https://github.com/RubyMetric/chsrc/issues/39
// 经测试Windows上调用换源命令会写入 C:\Users\RubyMetric\AppData\Roaming\pip\pip.ini
char *cmd = xy_2strjoin (py_prog_name, xy_2strjoin (" -m pip config --user set global.index-url ", source.url));
char *cmd = xy_2strcat (py_prog_name, xy_2strcat (" -m pip config --user set global.index-url ", source.url));
chsrc_run (cmd, RunOpt_No_Last_New_Line);
if (chsrc_in_standalone_mode())

View File

@@ -7,27 +7,21 @@ def_target(pl_python_uv, "uv");
void
pl_python_uv_prelude (void)
{
use_this(pl_python_uv);
chef_allow_gsr(pl_python_uv);
chef_prep_this (pl_python_uv, gsr);
chef_set_created_on (this, "2024-12-11");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-08-09");
chef_set_authors (this, 1, "happy game", "happygame1024@gmail.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"ccy", "icuichengyi@gmail.com",
"Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@happy-game");
chef_set_sauciers (this, 2, "@Kattos", "@ccmywish");
chef_allow_local_mode (this, FullyCan, NULL, NULL);
chef_allow_english(this);
chef_allow_user_define(this);
// 使用 pl_python_group 的源
this->sources = pl_python_group_target.sources;
this->sources_n = pl_python_group_target.sources_n;
chef_use_other_target_sources (this, &pl_python_group_target);
}
@@ -51,7 +45,7 @@ pl_python_find_uv_config (bool mkdir)
{
if (chsrc_in_local_mode())
{
return xy_2strjoin (PL_Python_uv_Local_ConfigPath, PL_Python_uv_ConfigFile);
return xy_2strcat (PL_Python_uv_Local_ConfigPath, PL_Python_uv_ConfigFile);
}
else
{
@@ -66,12 +60,12 @@ pl_python_find_uv_config (bool mkdir)
return NULL;
}
char *config_dir = xy_2strjoin(appdata, "\\uv\\");
char *config_dir = xy_2strcat(appdata, "\\uv\\");
if (mkdir)
{
chsrc_ensure_dir (config_dir);
}
return xy_2strjoin (config_dir, PL_Python_uv_ConfigFile);
return xy_2strcat (config_dir, PL_Python_uv_ConfigFile);
}
else
{
@@ -80,7 +74,7 @@ pl_python_find_uv_config (bool mkdir)
{
chsrc_ensure_dir (PL_Python_uv_User_ConfigPath);
}
return xy_2strjoin (PL_Python_uv_User_ConfigPath, PL_Python_uv_ConfigFile);
return xy_2strcat (PL_Python_uv_User_ConfigPath, PL_Python_uv_ConfigFile);
}
}
}
@@ -125,7 +119,7 @@ pl_python_uv_setsrc (char *option)
const char *source_content = xy_str_gsub (RAWSTR_pl_python_uv_config_source_content, "@url@", source.url);
#if defined(XY_On_macOS) || defined(XY_On_BSD)
#if defined(XY_Build_On_macOS) || defined(XY_Build_On_BSD)
char *sed_cmd = "sed -i '' ";
#else
char *sed_cmd = "sed -i ";

View File

@@ -7,17 +7,15 @@ def_target(pl_r, "r/cran");
void
pl_r_prelude ()
{
use_this(pl_r);
chef_allow_gs(pl_r);
chef_prep_this (pl_r, gs);
chef_set_created_on (this, "2023-09-21");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2023-09-04");
chef_set_sources_last_updated (this, "2025-08-21");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@hezonglun");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -25,7 +23,7 @@ pl_r_prelude ()
// 以下注释的是不含有bioconductor的镜像站我们在换cran的同时也直接帮助用户换bioconductor
def_sources_begin()
{&UpstreamProvider, NULL, DelegateToUpstream},
{&UpstreamProvider, "https://cran.r-project.org/", DelegateToUpstream},
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/cran/", DelegateToMirror},
// {&Ali, "https://mirrors.aliyun.com/CRAN/", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CRAN/", DelegateToMirror},
@@ -64,15 +62,15 @@ pl_r_getsrc (char *option)
void
pl_r_setsrc (char *option)
{
use_this_source(pl_r);
chsrc_use_this_source (pl_r);
char *bioconductor_url = xy_str_delete_suffix (xy_str_delete_suffix (source.url, "cran/"), "CRAN/");
bioconductor_url = xy_2strjoin(bioconductor_url, "bioconductor");
bioconductor_url = xy_2strcat(bioconductor_url, "bioconductor");
const char *w1 = xy_strjoin (3, "options(\"repos\" = c(CRAN=\"", source.url, "\"))\n" );
const char *w2 = xy_strjoin (3, "options(BioC_mirror=\"", bioconductor_url, "\")\n" );
const char *w1 = xy_strcat (3, "options(\"repos\" = c(CRAN=\"", source.url, "\"))\n" );
const char *w2 = xy_strcat (3, "options(BioC_mirror=\"", bioconductor_url, "\")\n" );
char *w = xy_2strjoin (w1, w2);
char *w = xy_2strcat (w1, w2);
// 或者我们调用 r.exe --slave -e 上面的内容

View File

@@ -14,17 +14,15 @@ def_target(pl_ruby, "gem/ruby/rb/rubygem/rubygems/bundler");
void
pl_ruby_prelude (void)
{
use_this(pl_ruby);
chef_allow_gsr(pl_ruby);
chef_prep_this (pl_ruby, gsr);
chef_set_created_on (this, "2023-08-29");
chef_set_last_updated (this, "2025-08-11");
chef_set_sources_last_updated (this, "2024-12-18");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, "Aoran Zeng", "ccmywish@qq.com");
chef_set_cooks (this, 0);
chef_set_contributors (this, 0);
chef_set_chef (this, "@ccmywish");
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, PartiallyCan, "支持 bundler. 不支持 gem", "Support bundler. Not support gem");
chef_allow_english(this);
@@ -58,7 +56,7 @@ pl_ruby_remove_gem_source (const char *source)
char *cmd = NULL;
if (chef_is_url (source))
{
cmd = xy_2strjoin ("gem sources -r ", source);
cmd = xy_2strcat ("gem sources -r ", source);
chsrc_run (cmd, RunOpt_Default);
}
return false
@@ -72,14 +70,14 @@ pl_ruby_setsrc (char *option)
{
chsrc_ensure_program ("gem");
use_this_source(pl_ruby);
chsrc_use_this_source (pl_ruby);
char *cmd = NULL;
// step1
xy_run_iter ("gem sources -l", 0, pl_ruby_remove_gem_source);
xy_run_iter_lines ("gem sources -l", 0, pl_ruby_remove_gem_source);
cmd = xy_2strjoin ("gem source -a ", source.url);
cmd = xy_2strcat ("gem source -a ", source.url);
chsrc_run (cmd, RunOpt_Default);
// 我们在 step1 中,把源全部清空了,但是现在 RubyGems 的行为是: 当清空会自动给你把默认源给加回来
@@ -95,7 +93,7 @@ pl_ruby_setsrc (char *option)
where = " --local ";
}
cmd = xy_strjoin (4, "bundle config", where, "'mirror.https://rubygems.org' ", source.url);
cmd = xy_strcat (4, "bundle config", where, "'mirror.https://rubygems.org' ", source.url);
chsrc_run (cmd, RunOpt_No_Last_New_Line);
chsrc_determine_chgtype (ChgType_Auto);

View File

@@ -7,19 +7,15 @@ def_target(pl_rust_cargo, "rust/cargo/crate/crates");
void
pl_rust_cargo_prelude (void)
{
use_this(pl_rust_cargo);
chef_allow_gsr(pl_rust_cargo);
chef_prep_this (pl_rust_cargo, gsr);
chef_set_created_on (this, "2023-08-30");
chef_set_last_updated (this, "2025-07-22");
chef_set_sources_last_updated (this, "2025-06-18");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Mikachu2333", "mikachu.23333@zohomail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Mikachu2333");
chef_allow_local_mode (this, PartiallyCan, "可以基于本项目换源吗?请帮助确认", "Can it change sources based on this project? Please help confirm");
chef_forbid_english (this);
@@ -66,13 +62,13 @@ pl_rust_cargo_getsrc (char *option)
void
pl_rust_cargo_setsrc (char *option)
{
use_this_source(pl_rust_cargo);
chsrc_use_this_source (pl_rust_cargo);
char *content = RAWSTR_pl_rust_cargo_config;
content = xy_str_gsub (content, "@url@", source.url);
chsrc_note2 (xy_strjoin (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:"));
chsrc_note2 (xy_strcat (3, "请手动写入以下内容到 ", xy_normalize_path ("~/.cargo/config.toml"), " 文件中:"));
println (content);
chsrc_determine_chgtype (ChgType_Auto);

View File

@@ -10,19 +10,15 @@ def_target(pl_rust_rustup, "rustup");
void
pl_rust_rustup_prelude (void)
{
use_this(pl_rust_rustup);
chef_allow_gsr(pl_rust_rustup);
chef_prep_this (pl_rust_rustup, gsr);
chef_set_created_on (this, "2024-10-02");
chef_set_last_updated (this, "2025-08-07");
chef_set_sources_last_updated (this, "2025-08-07");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"Yangmoooo", "yangmoooo@outlook.com",
"Mikachu2333", "mikachu.23333@zohomail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@Yangmoooo", "@Mikachu2333");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english (this);
@@ -60,22 +56,22 @@ pl_rust_rustup_getsrc (char *option)
void
pl_rust_rustup_setsrc (char *option)
{
use_this_source(pl_rust_rustup);
chsrc_use_this_source (pl_rust_rustup);
#ifdef XY_On_Windows
#ifdef XY_Build_On_Windows
char *cmd1 = xy_strjoin (3, "setx RUSTUP_DIST_SERVER \"", source.url, "\"");
char *cmd2 = xy_strjoin (3, "setx RUSTUP_UPDATE_ROOT \"", source.url, "/rustup\"");
char *cmd1 = xy_strcat (3, "setx RUSTUP_DIST_SERVER \"", source.url, "\"");
char *cmd2 = xy_strcat (3, "setx RUSTUP_UPDATE_ROOT \"", source.url, "/rustup\"");
char *cmd = xy_strjoin (3, cmd1, " & ", cmd2);
char *cmd = xy_strcat (3, cmd1, " & ", cmd2);
chsrc_run (cmd, RunOpt_Dont_Notify_On_Success|RunOpt_No_Last_New_Line);
#else
char *w1 = xy_strjoin (3, "export RUSTUP_DIST_SERVER=\"", source.url, "\"\n");
char *w2 = xy_strjoin (3, "export RUSTUP_UPDATE_ROOT=\"", source.url, "/rustup\"\n");
char *w1 = xy_strcat (3, "export RUSTUP_DIST_SERVER=\"", source.url, "\"\n");
char *w2 = xy_strcat (3, "export RUSTUP_UPDATE_ROOT=\"", source.url, "/rustup\"\n");
char *w = xy_2strjoin (w1, w2);
char *w = xy_2strcat (w1, w2);
char *bashrc = xy_bashrc;
if (xy_file_exist (bashrc))
@@ -94,10 +90,10 @@ pl_rust_rustup_setsrc (char *option)
char *fishrc = xy_fishrc;
if (xy_file_exist (fishrc))
{
char *w1 = xy_strjoin (3, "set -x RUSTUP_DIST_SERVER ", source.url, "\n");
char *w2 = xy_strjoin (3, "set -x RUSTUP_UPDATE_ROOT ", source.url, "/rustup\n");
char *w1 = xy_strcat (3, "set -x RUSTUP_DIST_SERVER ", source.url, "\n");
char *w2 = xy_strcat (3, "set -x RUSTUP_UPDATE_ROOT ", source.url, "/rustup\n");
char *w = xy_2strjoin (w1, w2);
char *w = xy_2strcat (w1, w2);
chsrc_backup (fishrc);
chsrc_append_to_file (w, fishrc);