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);

View File

@@ -1,102 +1,192 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Aoran Zeng <ccmywish@qq.com>
* File Authors : 曾奥然 <ccmywish@qq.com>
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
* |
* Created On : <2023-09-01>
* Major Revision : 3
* Last Modified : <2025-08-10>
* Major Revision : 5
* Last Modified : <2025-08-22>
* ------------------------------------------------------------*/
#define t(o) &o##_target, &o##_prelude
#include "lang/rawstr4c.h"
TargetRegisterInfo_t
chsrc_pl_menu[] =
#include "lang/Ruby/Ruby.c"
#include "lang/Python/common.h"
#include "lang/Python/pip.c"
#include "lang/Python/Poetry.c"
#include "lang/Python/PDM.c"
#include "lang/Python/Rye.c"
#include "lang/Python/uv.c"
#include "lang/Python/Python.c"
#include "lang/JavaScript/common.h"
#include "lang/JavaScript/npm.c"
#include "lang/JavaScript/pnpm.c"
#include "lang/JavaScript/Yarn.c"
#include "lang/JavaScript/JavaScript.c"
#include "lang/JavaScript/Bun.c"
#include "lang/JavaScript/nvm.c"
#include "lang/Perl.c"
#include "lang/PHP.c"
#include "lang/Lua.c"
#include "lang/Go.c"
#include "lang/Java.c"
#include "lang/Rust/common.h"
#include "lang/Rust/rustup.c"
#include "lang/Rust/Cargo.c"
#include "lang/Dart/common.h"
#include "lang/Dart/Pub.c"
#include "lang/Dart/Flutter.c"
#include "lang/Haskell.c"
#include "lang/OCaml.c"
#include "lang/R.c"
#include "lang/Julia.c"
#include "lang/NuGet.c"
#include "lang/Clojure.c"
#include "os/rawstr4c.h"
#include "os/APT/common.h"
// Debian-based
#include "os/APT/Debian.c"
#include "os/APT/Ubuntu.c"
#include "os/APT/Kali-Linux.c"
#include "os/APT/Raspberry-Pi-OS.c"
// Ubuntu-based
#include "os/APT/Linux-Mint.c"
#include "os/APT/Trisquel.c"
#include "os/APT/Linux-Lite.c"
// Debian-based and Ubuntu-based
#include "os/APT/Armbian.c"
// Independent
#include "os/APT/ROS.c"
#include "os/APT/Termux.c"
#include "os/APT/openKylin.c"
#include "os/APT/deepin.c"
#include "os/YUM/common.h"
#include "os/YUM/Fedora-Linux.c"
#include "os/YUM/AlmaLinux.c"
#include "os/YUM/Rocky-Linux.c"
#include "os/YUM/openEuler.c"
#include "os/YUM/Anolis-OS.c"
#include "os/pacman/Arch-Linux.c"
#include "os/pacman/Manjaro-Linux.c"
#include "os/pacman/MSYS2.c"
#include "os/openSUSE.c"
#include "os/Alpine-Linux.c"
#include "os/Gentoo-Linux.c"
#include "os/Void-Linux.c"
#include "os/Solus.c"
#include "os/OpenWrt.c"
#include "os/BSD/FreeBSD.c"
#include "os/BSD/NetBSD.c"
#include "os/BSD/OpenBSD.c"
#include "ware/TeX-Live.c"
#include "ware/Emacs.c"
#include "ware/WinGet.c"
#include "ware/Homebrew/Homebrew.c"
#include "ware/CocoaPods.c"
#include "ware/Nix.c"
#include "ware/Guix.c"
#include "ware/Flatpak.c"
#include "ware/Docker/Docker.c"
#include "ware/Anaconda/Anaconda.c"
void
chsrc_init_menu ()
{
{t(pl_ruby)},
{t(pl_python_group)},
{t(pl_python_pip)},
{t(pl_python_poetry)},
{t(pl_python_pdm)},
{t(pl_python_rye)},
{t(pl_python_uv)},
{t(pl_js_group)},
{t(pl_js_bun)},
{t(pl_js_npm)},
{t(pl_js_yarn)},
{t(pl_js_pnpm)},
{t(pl_js_nvm)},
{t(pl_perl)},
{t(pl_php)},
{t(pl_lua)},
{t(pl_go)},
{t(pl_rust_cargo)},
{t(pl_rust_rustup)},
{t(pl_java)},
{t(pl_clojure)},
{t(pl_dart)},
{t(pl_dart_flutter)},
{t(pl_nuget)},
{t(pl_haskell)},
{t(pl_ocaml)},
{t(pl_r)},
{t(pl_julia)},
};
#define add(t) xy_seq_push(ProgStore.pl, &pl_##t##_target); (&pl_##t##_target)->preludefn = pl_##t##_prelude
add (ruby);
add (python_group);
add (python_pip);
add (python_poetry);
add (python_pdm);
add (python_rye);
add (python_uv);
add (js_group);
add (js_bun);
add (js_npm);
add (js_yarn);
add (js_pnpm);
add (js_nvm);
add (perl);
add (php);
add (lua);
add (go);
add (rust_cargo);
add (rust_rustup);
add (java);
add (clojure);
add (dart);
add (dart_flutter);
add (nuget);
add (haskell);
add (ocaml);
add (r);
add (julia);
#undef add
#define add(t) xy_seq_push(ProgStore.os, &os_##t##_target); (&os_##t##_target)->preludefn = os_##t##_prelude
add (ubuntu);
add (linuxmint);
add (debian);
add (fedora);
add (opensuse);
add (kali);
add (msys2);
add (arch);
add (archlinuxcn);
add (manjaro);
add (gentoo);
add (rockylinux);
add (almalinux);
add (alpine);
add (voidlinux);
add (solus);
add (trisquel);
add (linuxlite);
add (ros);
add (raspberrypi);
add (armbian);
add (openwrt);
add (termux);
add (openkylin);
add (openeuler);
add (anolis);
add (deepin);
add (freebsd);
add (netbsd);
add (openbsd);
#undef add
#define add(t) xy_seq_push(ProgStore.wr, &wr_##t##_target); (&wr_##t##_target)->preludefn = wr_##t##_prelude
add (winget);
add (homebrew);
add (cocoapods);
add (docker);
add (flatpak);
add (nix);
add (guix);
add (emacs);
add (tex);
add (anaconda);
#undef add
TargetRegisterInfo_t
chsrc_os_menu[] =
{
{t(os_ubuntu)},
{t(os_linuxmint)},
{t(os_debian)},
{t(os_fedora)},
{t(os_opensuse)},
{t(os_kali)},
{t(os_msys2)},
{t(os_arch)},
{t(os_archlinuxcn)},
{t(os_manjaro)},
{t(os_gentoo)},
{t(os_rockylinux)},
{t(os_almalinux)},
{t(os_alpine)},
{t(os_voidlinux)},
{t(os_solus)},
{t(os_trisquel)},
{t(os_linuxlite)},
{t(os_ros)},
{t(os_raspberrypi)},
{t(os_armbian)},
{t(os_openwrt)},
{t(os_termux)},
{t(os_openkylin)},
{t(os_openeuler)},
{t(os_anolis)},
{t(os_deepin)},
{t(os_freebsd)},
{t(os_netbsd)},
{t(os_openbsd)},
};
TargetRegisterInfo_t
chsrc_wr_menu[] =
{
{t(wr_winget)},
{t(wr_homebrew)},
{t(wr_cocoapods)},
{t(wr_docker)},
{t(wr_flatpak)},
{t(wr_nix)},
{t(wr_guix)},
{t(wr_emacs)},
{t(wr_tex)},
{t(wr_anaconda)},
};
#undef t
// Internal Target 不会由用户使用,需要特殊对待
pl_js_nodejs_binary_target.preludefn = pl_js_nodejs_binary_prelude;
}

View File

@@ -7,19 +7,15 @@ def_target(os_armbian, "armbian");
void
os_armbian_prelude ()
{
use_this(os_armbian);
chef_allow_gsr(os_armbian);
chef_prep_this (os_armbian, gsr);
chef_set_created_on (this, "2024-06-14");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-11-21");
chef_set_authors (this, 1, "Shengwei Chen", "414685209@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"Aoran Zeng", "ccmywish@qq.com",
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@livelycode36");
chef_set_sauciers (this, 2, "@ccmywish", "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -64,11 +60,11 @@ os_armbian_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_armbian);
chsrc_use_this_source (os_armbian);
chsrc_backup (OS_Armbian_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?[^ ]*armbian/?[^ ]*@", source.url,
char *cmd = xy_strcat (3, "sed -E -i 's@https?[^ ]*armbian/?[^ ]*@", source.url,
"@g' " OS_Armbian_SourceList);
chsrc_run (cmd, RunOpt_Default);

View File

@@ -7,20 +7,15 @@ def_target(os_debian, "debian");
void
os_debian_prelude ()
{
use_this(os_debian);
chef_allow_gsr(os_debian);
chef_prep_this (os_debian, gsr);
chef_set_created_on (this, "2023-09-02");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-11");
chef_set_authors (this, 2,
"Aoran Zeng", "ccmywish@qq.com",
"Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 2, "@ccmywish", "@G_I_Y");
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -77,7 +72,7 @@ static bool
os_debian_does_old_sourcelist_use_cdrom (void)
{
/* 我们只检查旧版sourcelist因为 common.h 中的填充只支持旧版 */
char *cmd = xy_2strjoin ("grep -q '^deb cdrom:' ", OS_Debian_old_SourceList);
char *cmd = xy_2strcat ("grep -q '^deb cdrom:' ", OS_Debian_old_SourceList);
int ret = system (cmd);
bool use_cdrom = ret == 0;
@@ -88,15 +83,15 @@ os_debian_does_old_sourcelist_use_cdrom (void)
void
os_debian_setsrc_for_deb822 (char *option)
{
use_this_source(os_debian);
chsrc_use_this_source (os_debian);
chsrc_backup (OS_Debian_SourceList_DEB822);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/debian/?@", source.url, "@g' " OS_Debian_SourceList_DEB822);
char *cmd = xy_strcat (3, "sed -E -i 's@https?://.*/debian/?@", source.url, "@g' " OS_Debian_SourceList_DEB822);
chsrc_run (cmd, RunOpt_Default);
/* debian-security 源和其他源不一样 */
cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/debian-security/?@", source.url, "-security@g' " OS_Debian_SourceList_DEB822);
cmd = xy_strcat (3, "sed -E -i 's@https?://.*/debian-security/?@", source.url, "-security@g' " OS_Debian_SourceList_DEB822);
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
@@ -149,7 +144,7 @@ os_debian_setsrc (char *option)
}
}
use_this_source(os_debian);
chsrc_use_this_source (os_debian);
chsrc_alert2 ("如果遇到无法拉取 HTTPS 源的情况,请手动运行:");
say ("apt install apt-transport-https ca-certificates");
@@ -160,7 +155,7 @@ os_debian_setsrc (char *option)
chsrc_backup (OS_Debian_old_SourceList);
}
char *cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/debian/?@", source.url, "@g\' " OS_Debian_old_SourceList);
char *cmd = xy_strcat (3, "sed -E -i \'s@https?://.*/debian/?@", source.url, "@g\' " OS_Debian_old_SourceList);
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);

View File

@@ -7,19 +7,15 @@ def_target(os_kali, "kali");
void
os_kali_prelude ()
{
use_this(os_kali);
chef_allow_gsr(os_kali);
chef_prep_this (os_kali, gsr);
chef_set_created_on (this, "2023-09-29");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"Yangmoooo", "yangmoooo@outlook.com",
"Happy Game", "happygame1024@gmail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@G_I_Y");
chef_set_sauciers (this, 2, "@Yangmoooo", "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -51,11 +47,11 @@ os_kali_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_kali);
chsrc_use_this_source (os_kali);
chsrc_backup (OS_Apt_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/kali/?@",
char *cmd = xy_strcat (3, "sed -E -i \'s@https?://.*/kali/?@",
source.url,
"@g\' " OS_Apt_SourceList);

View File

@@ -7,18 +7,15 @@ def_target(os_linuxlite, "linuxlite");
void
os_linuxlite_prelude ()
{
use_this(os_linuxlite);
chef_allow_gsr(os_linuxlite);
chef_prep_this (os_linuxlite, gsr);
chef_set_created_on (this, "2023-09-29");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-11-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, 1,
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -49,11 +46,11 @@ os_linuxlite_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_linuxlite);
chsrc_use_this_source (os_linuxlite);
chsrc_backup (OS_Apt_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/.*/?@", source.url, "@g' " OS_Apt_SourceList);
char *cmd = xy_strcat (3, "sed -E -i 's@https?://.*/.*/?@", source.url, "@g' " OS_Apt_SourceList);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);

View File

@@ -7,18 +7,15 @@ def_target(os_linuxmint, "linuxmint");
void
os_linuxmint_prelude ()
{
use_this(os_linuxmint);
chef_allow_gs(os_linuxmint);
chef_prep_this (os_linuxmint, gs);
chef_set_created_on (this, "2023-09-29");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-11-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, 1,
"Happy Game", "happygame1024@gmail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -61,7 +58,7 @@ os_linuxmint_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_linuxmint);
chsrc_use_this_source (os_linuxmint);
chsrc_backup (OS_LinuxMint_SourceList);
@@ -69,7 +66,7 @@ os_linuxmint_setsrc (char *option)
// 暂不实现自动替换基于debian或ubuntu的基础源
char *version_codename = xy_run ("sed -nr 's/^VERSION_CODENAME=([^\"]+)/\1/p' " ETC_OS_RELEASE, 0);
// sed -i '/<version_codename>/ s|http[^ ]*|<source.url>|g' OS_LinuxMint_SourceList
char* cmd = xy_strjoin (5, "sed -i '/",
char* cmd = xy_strcat (5, "sed -i '/",
version_codename, "/ s|http[^ ]*|",
source.url, "|g' " OS_LinuxMint_SourceList);

View File

@@ -7,19 +7,15 @@ def_target(os_ros, "ros/ros2");
void
os_ros_prelude ()
{
use_this(os_ros);
chef_allow_gs(os_ros);
chef_prep_this (os_ros, gs);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-04-18");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 2,
"Aoran Zeng", "ccmywish@qq.com",
"zouri", "guoshuaisun@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@G_I_Y");
chef_set_sauciers (this, 2, "@ccmywish", "@zouri");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -59,12 +55,12 @@ os_ros_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_ros);
chsrc_use_this_source (os_ros);
chsrc_backup (OS_ROS_SourceList);
char *cmd = NULL;
cmd = xy_strjoin(3, "sed -E -i \'s@https?://.*/ros/ubuntu/?@", source.url, "/ros/ubuntu@g\' " OS_ROS_SourceList);
cmd = xy_strcat(3, "sed -E -i \'s@https?://.*/ros/ubuntu/?@", source.url, "/ros/ubuntu@g\' " OS_ROS_SourceList);
chsrc_run(cmd, RunOpt_Default);
cmd = "apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654";

View File

@@ -9,18 +9,15 @@ def_target(os_raspberrypi, "raspi/raspberrypi");
void
os_raspberrypi_prelude ()
{
use_this(os_raspberrypi);
chef_allow_gsr(os_raspberrypi);
chef_prep_this (os_raspberrypi, gsr);
chef_set_created_on (this, "2023-09-29");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2023-09-29");
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,
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -53,11 +50,11 @@ os_raspberrypi_setsrc (char *option)
{
chsrc_ensure_root(); // HELP: 不确定是否需要
use_this_source(os_raspberrypi);
chsrc_use_this_source (os_raspberrypi);
chsrc_backup (OS_RaspberryPi_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/.*/?@", source.url,
char *cmd = xy_strcat (3, "sed -E -i 's@https?://.*/.*/?@", source.url,
"@g' " OS_RaspberryPi_SourceList);
chsrc_run (cmd, RunOpt_Default);

View File

@@ -7,17 +7,15 @@ def_target(os_termux, "termux");
void
os_termux_prelude ()
{
use_this(os_termux);
chef_allow_gsr(os_termux);
chef_prep_this (os_termux, gsr);
chef_set_created_on (this, "2025-03-04");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-03-04");
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);
@@ -61,9 +59,9 @@ os_termux_setsrc (char *option)
// chsrc_ensure_root (); Termux下禁止使用root
use_this_source(os_termux);
chsrc_use_this_source (os_termux);
char *cmd = xy_strjoin (3, "sed -i 's@^\\(deb.*stable main\\)$@#\\1\\ndeb ",
char *cmd = xy_strcat (3, "sed -i 's@^\\(deb.*stable main\\)$@#\\1\\ndeb ",
source.url, "apt/termux-main stable main@' " OS_Termux_SourceList);
chsrc_run (cmd, RunOpt_Default);

View File

@@ -9,17 +9,15 @@ def_target(os_trisquel, "trisquel");
void
os_trisquel_prelude ()
{
use_this(os_trisquel);
chef_allow_gsr(os_trisquel);
chef_prep_this (os_trisquel, gsr);
chef_set_created_on (this, "2023-09-29");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-11-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, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -53,11 +51,11 @@ os_trisquel_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_trisquel);
chsrc_use_this_source (os_trisquel);
chsrc_backup (OS_Apt_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/trisquel/?@", source.url, "@g' /etc/apt/sources.list");
char *cmd = xy_strcat (3, "sed -E -i 's@https?://.*/trisquel/?@", source.url, "@g' /etc/apt/sources.list");
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);

View File

@@ -8,20 +8,15 @@ def_target(os_ubuntu, "ubuntu/zorinos");
void
os_ubuntu_prelude ()
{
use_this(os_ubuntu);
chef_allow_gsr(os_ubuntu);
chef_prep_this (os_ubuntu, 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-11");
chef_set_authors (this, 2,
"Aoran Zeng", "ccmywish@qq.com",
"Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Zhao", "1792582687@qq.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 2, "@ccmywish", "@G_I_Y");
chef_set_sauciers (this, 1, "@XUANJI233");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -80,7 +75,7 @@ os_ubuntu_getsrc (char *option)
void
os_ubuntu_setsrc_for_deb822 (char *option)
{
use_this_source(os_ubuntu);
chsrc_use_this_source (os_ubuntu);
chsrc_backup (OS_Ubuntu_SourceList_DEB822);
@@ -88,11 +83,11 @@ os_ubuntu_setsrc_for_deb822 (char *option)
char *cmd = NULL;
if (strncmp (arch, "x86_64", 6)==0)
{
cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/ubuntu/?@", source.url, "@g\' " OS_Ubuntu_SourceList_DEB822);
cmd = xy_strcat (3, "sed -E -i \'s@https?://.*/ubuntu/?@", source.url, "@g\' " OS_Ubuntu_SourceList_DEB822);
}
else
{
cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/ubuntu-ports/?@", source.url, "-ports@g\' " OS_Ubuntu_SourceList_DEB822);
cmd = xy_strcat (3, "sed -E -i \'s@https?://.*/ubuntu-ports/?@", source.url, "-ports@g\' " OS_Ubuntu_SourceList_DEB822);
}
chsrc_run (cmd, RunOpt_Default);
@@ -123,7 +118,7 @@ os_ubuntu_setsrc (char *option)
bool sourcelist_exist = ensure_debian_or_ubuntu_old_sourcelist (OS_Is_Ubuntu);
use_this_source(os_ubuntu);
chsrc_use_this_source (os_ubuntu);
/* 不存在的时候,用的是我们生成的无效文件,不要备份 */
if (sourcelist_exist)
@@ -135,11 +130,11 @@ os_ubuntu_setsrc (char *option)
char *cmd = NULL;
if (0==strncmp (arch, "x86_64", 6))
{
cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/ubuntu/?@", source.url, "@g\' " OS_Ubuntu_old_SourceList);
cmd = xy_strcat (3, "sed -E -i \'s@https?://.*/ubuntu/?@", source.url, "@g\' " OS_Ubuntu_old_SourceList);
}
else
{
cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/ubuntu-ports/?@", source.url, "-ports@g\' " OS_Ubuntu_old_SourceList);
cmd = xy_strcat (3, "sed -E -i \'s@https?://.*/ubuntu-ports/?@", source.url, "-ports@g\' " OS_Ubuntu_old_SourceList);
}
chsrc_run (cmd, RunOpt_Default);

View File

@@ -7,18 +7,15 @@ def_target(os_deepin, "deepin");
void
os_deepin_prelude ()
{
use_this(os_deepin);
chef_allow_gsr(os_deepin);
chef_prep_this (os_deepin, gsr);
chef_set_created_on (this, "2023-09-26");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-09-14");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@G_I_Y");
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -56,11 +53,11 @@ os_deepin_setsrc (char *option)
{
chsrc_ensure_root();
use_this_source(os_deepin);
chsrc_use_this_source (os_deepin);
chsrc_backup (OS_Apt_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/deepin/?@",
char *cmd = xy_strcat (3, "sed -E -i \'s@https?://.*/deepin/?@",
source.url,
"@g\' " OS_Apt_SourceList);

View File

@@ -10,18 +10,15 @@ def_target(os_openkylin, "openkylin");
void
os_openkylin_prelude ()
{
use_this(os_openkylin);
chef_allow_gsr(os_openkylin);
chef_prep_this (os_openkylin, gsr);
chef_set_created_on (this, "2023-09-06");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2023-09-29");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@G_I_Y");
chef_set_sauciers (this, 1, "@ccmywish");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -47,11 +44,11 @@ os_openkylin_setsrc (char *option)
{
chsrc_ensure_root();
use_this_source(os_openkylin);
chsrc_use_this_source (os_openkylin);
chsrc_backup (OS_Apt_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/openkylin/?@", source.url, "@g'" OS_Apt_SourceList);
char *cmd = xy_strcat (3, "sed -E -i 's@https?://.*/openkylin/?@", source.url, "@g'" OS_Apt_SourceList);
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);

View File

@@ -7,18 +7,15 @@ def_target(os_alpine, "alpine");
void
os_alpine_prelude ()
{
use_this(os_alpine);
chef_allow_gs(os_alpine);
chef_prep_this (os_alpine, gs);
chef_set_created_on (this, "2023-09-24");
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, 1,
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
@@ -57,9 +54,9 @@ os_alpine_setsrc (char *option)
{
// chsrc_ensure_root(); // HELP: 不确定是否需要root
use_this_source(os_alpine);
chsrc_use_this_source (os_alpine);
char* cmd = xy_strjoin (3,
char* cmd = xy_strcat (3,
"sed -i 's#https\\?://dl-cdn.alpinelinux.org/alpine#", source.url, "#g' /etc/apk/repositories"
);
chsrc_run (cmd, RunOpt_Default);

View File

@@ -7,17 +7,15 @@ def_target(os_freebsd, "freebsd");
void
os_freebsd_prelude ()
{
use_this(os_freebsd);
chef_allow_s(os_freebsd);
chef_prep_this (os_freebsd, s);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2023-09-27");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com", "Heng Guo", "2085471348@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, 2, "@ccmywish", "@G_I_Y");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -48,7 +46,7 @@ os_freebsd_setsrc (char *option)
// 据 @yklaFreeBSD不自带sudo但是我们依然要保证是root权限
chsrc_ensure_root ();
use_this(os_freebsd);
use_this (os_freebsd);
int index = use_specific_mirror_or_auto_select (option, this);
Source_t source = this->sources[index];
@@ -57,9 +55,9 @@ os_freebsd_setsrc (char *option)
chsrc_log2 ("1. 添加 freebsd-pkg 源 (二进制安装包)");
chsrc_ensure_dir ("/usr/local/etc/pkg/repos");
char *conf = xy_strjoin (3, "/usr/local/etc/pkg/repos/", source.mirror->code, ".conf");
char *conf = xy_strcat (3, "/usr/local/etc/pkg/repos/", source.mirror->code, ".conf");
char *pkg_content = xy_strjoin (4,
char *pkg_content = xy_strcat (4,
source.mirror->code, ": { \n"
" url: \"http://", source.url, "/freebsd-pkg/${ABI}/latest\",\n"
"}\n"
@@ -68,7 +66,7 @@ os_freebsd_setsrc (char *option)
chsrc_overwrite_file (pkg_content, conf);
chsrc_note2 (
xy_strjoin (3, "若要使用季度分支,请在", conf ,"中将latest改为quarterly"));
xy_strcat (3, "若要使用季度分支,请在", conf ,"中将latest改为quarterly"));
chsrc_alert2 ("若要使用HTTPS源请先安装securtiy/ca_root_ns并将'http'改成'https',最后使用'pkg update -f'刷新缓存即可\n");
br();
@@ -84,14 +82,14 @@ os_freebsd_setsrc (char *option)
{
source = this->sources[index-1]; // 使用NJU的前一个源即USTC源
}
char *git_cmd = xy_strjoin (3, "git clone --depth 1 https://", source.url, "/freebsd-ports/ports.git /usr/ports");
char *git_cmd = xy_strcat (3, "git clone --depth 1 https://", source.url, "/freebsd-ports/ports.git /usr/ports");
chsrc_run (git_cmd, RunOpt_Default);
source = this->sources[index]; // 恢复至选中的源
chsrc_alert2 ("下次更新请使用 git -C /usr/ports pull 而非使用 gitup");
}
else
{
char *fetch = xy_strjoin (3, "fetch https://", source.url, "/freebsd-ports/ports.tar.gz"); // 70多MB
char *fetch = xy_strcat (3, "fetch https://", source.url, "/freebsd-ports/ports.tar.gz"); // 70多MB
char *unzip = "tar -zxvf ports.tar.gz -C /usr/ports";
char *delete = "rm ports.tar.gz";
chsrc_run (fetch, RunOpt_Default);
@@ -105,7 +103,7 @@ os_freebsd_setsrc (char *option)
// https://help.mirrors.cernet.edu.cn/FreeBSD-ports/
chsrc_backup ("/etc/make.conf");
char *ports = xy_strjoin (3, "MASTER_SITE_OVERRIDE?=http://", source.url, "/freebsd-ports/distfiles/${DIST_SUBDIR}/\n");
char *ports = xy_strcat (3, "MASTER_SITE_OVERRIDE?=http://", source.url, "/freebsd-ports/distfiles/${DIST_SUBDIR}/\n");
chsrc_append_to_file (ports, "/etc/make.conf");
@@ -113,7 +111,7 @@ os_freebsd_setsrc (char *option)
/*
chsrc_backup ("/etc/portsnap.conf");
char *portsnap =xy_strjoin(3,"s@(.*)SERVERNAME=[\\.|a-z|A-Z]*@\\1SERVERNAME=", source.url,
char *portsnap =xy_strcat(3,"s@(.*)SERVERNAME=[\\.|a-z|A-Z]*@\\1SERVERNAME=", source.url,
"@g < /etc/portsnap.conf.bak");
chsrc_overwrite_file (portsnap, "/etc/portsnap.conf");
@@ -131,7 +129,7 @@ os_freebsd_setsrc (char *option)
char *update_cp = "cp /etc/freebsd-update.conf /etc/freebsd-update.conf.bak";
chsrc_run (update_cp, RunOpt_Default);
char *update =xy_strjoin (3,"s@(.*)SERVERNAME [\\.|a-z|A-Z]*@\\1SERVERNAME ",
char *update =xy_strcat (3,"s@(.*)SERVERNAME [\\.|a-z|A-Z]*@\\1SERVERNAME ",
source.url,
"@g < /etc/freebsd-update.conf.bak");

View File

@@ -7,17 +7,15 @@ def_target(os_netbsd, "netbsd");
void
os_netbsd_prelude ()
{
use_this(os_netbsd);
chef_allow_gs(os_netbsd);
chef_prep_this (os_netbsd, gs);
chef_set_created_on (this, "2023-09-05");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-31");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com", "Heng Guo", "2085471348@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, 2, "@ccmywish", "@G_I_Y");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
@@ -60,7 +58,7 @@ os_netbsd_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_netbsd);
chsrc_use_this_source (os_netbsd);
chsrc_backup ("/usr/pkg/etc/pkgin/repositories.conf");
@@ -68,7 +66,7 @@ os_netbsd_setsrc (char *option)
char *vercmd = "cat /etc/os-release | grep \"VERSION=\" | grep -Po \"[8-9].[0-9]+\"";
char *version = xy_run (vercmd, 0);
char *url = xy_strjoin (5, chef_ensure_trailing_slash (source.url), arch, "/", version, "/All");
char *url = xy_strcat (5, chef_ensure_trailing_slash (source.url), arch, "/", version, "/All");
chsrc_overwrite_file (url, "/usr/pkg/etc/pkgin/repositories.conf");
chsrc_conclude (&source);

View File

@@ -7,17 +7,15 @@ def_target(os_openbsd, "openbsd");
void
os_openbsd_prelude ()
{
use_this(os_openbsd);
chef_allow_gs(os_openbsd);
chef_prep_this (os_openbsd, gs);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-31");
chef_set_authors (this, 2, "Heng Guo", "2085471348@qq.com", "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, 2, "@G_I_Y", "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -59,7 +57,7 @@ os_openbsd_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_openbsd);
chsrc_use_this_source (os_openbsd);
chsrc_backup ("/etc/installurl");
chsrc_overwrite_file (source.url, "/etc/installurl");

View File

@@ -7,18 +7,15 @@ def_target(os_gentoo, "gentoo");
void
os_gentoo_prelude ()
{
use_this(os_gentoo);
chef_allow_s(os_gentoo);
chef_prep_this (os_gentoo, s);
chef_set_created_on (this, "2023-09-05");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@G_I_Y");
chef_set_sauciers (this, 1, "@ccmywish");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
@@ -45,16 +42,16 @@ os_gentoo_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_gentoo);
chsrc_use_this_source (os_gentoo);
chsrc_backup ("/etc/portage/repos.conf/gentoo.conf");
char *cmd = xy_strjoin (3, "sed -i \"s#rsync://.*/gentoo-portage#rsync://",
char *cmd = xy_strcat (3, "sed -i \"s#rsync://.*/gentoo-portage#rsync://",
source.url,
"gentoo-portage#g");
chsrc_run (cmd, RunOpt_Default);
char *w = xy_strjoin (3, "GENTOO_MIRRORS=\"https://", source.url, "gentoo\"\n");
char *w = xy_strcat (3, "GENTOO_MIRRORS=\"https://", source.url, "gentoo\"\n");
chsrc_append_to_file (w, "/etc/portage/make.conf");

View File

@@ -7,19 +7,15 @@ def_target(os_openwrt, "openwrt/opkg/LEDE");
void
os_openwrt_prelude ()
{
use_this(os_openwrt);
chef_allow_gsr(os_openwrt);
chef_prep_this (os_openwrt, gsr);
chef_set_created_on (this, "2024-08-08");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-12-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, 2,
"Yangmoooo", "yangmoooo@outlook.com",
"happy game", "happygame1024@gmail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@Yangmoooo", "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
@@ -61,11 +57,11 @@ os_openwrt_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_openwrt);
chsrc_use_this_source (os_openwrt);
chsrc_backup (OS_OpenWRT_SourceConfig);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/releases@", source.url, "/releases@g' " OS_OpenWRT_SourceConfig);
char *cmd = xy_strcat (3, "sed -E -i 's@https?://.*/releases@", source.url, "/releases@g' " OS_OpenWRT_SourceConfig);
chsrc_run (cmd, RunOpt_No_Last_New_Line);
chsrc_run ("opkg update", RunOpt_No_Last_New_Line);

View File

@@ -7,17 +7,15 @@ def_target(os_solus, "solus");
void
os_solus_prelude ()
{
use_this(os_solus);
chef_allow_s(os_solus);
chef_prep_this (os_solus, s);
chef_set_created_on (this, "2023-09-29");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2023-09-29");
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);
@@ -43,9 +41,9 @@ os_solus_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_solus);
chsrc_use_this_source (os_solus);
char *cmd = xy_2strjoin ("eopkg add-repo Solus ", source.url);
char *cmd = xy_2strcat ("eopkg add-repo Solus ", source.url);
chsrc_run (cmd, RunOpt_Default);
chsrc_determine_chgtype (ChgType_Auto);

View File

@@ -7,18 +7,15 @@ def_target(os_voidlinux, "voidlinux");
void
os_voidlinux_prelude ()
{
use_this(os_voidlinux);
chef_allow_gsr(os_voidlinux);
chef_prep_this (os_voidlinux, gsr);
chef_set_created_on (this, "2023-09-24");
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,
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -52,18 +49,18 @@ os_voidlinux_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_voidlinux);
chsrc_use_this_source (os_voidlinux);
chsrc_ensure_dir ("/etc/xbps.d");
char *cmd = "cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/";
chsrc_run (cmd, RunOpt_Default);
cmd = xy_strjoin (3,
cmd = xy_strcat (3,
"sed -i 's|https://repo-default.voidlinux.org|", source.url, "|g' /etc/xbps.d/*-repository-*.conf"
);
chsrc_run (cmd, RunOpt_Default);
cmd = xy_strjoin (3,
cmd = xy_strcat (3,
"sed -i 's|https://alpha.de.repo.voidlinux.org|", source.url, "|g' /etc/xbps.d/*-repository-*.conf"
);

View File

@@ -7,18 +7,15 @@ def_target(os_almalinux, "alma/almalinux");
void
os_almalinux_prelude ()
{
use_this(os_almalinux);
chef_allow_s(os_almalinux);
chef_prep_this (os_almalinux, s);
chef_set_created_on (this, "2024-06-12");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-12-18");
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, 1,
"Yangmoooo", "yangmoooo@outlook.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Yangmoooo");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -27,7 +24,7 @@ os_almalinux_prelude ()
chef_set_note(this, NULL, NULL);
def_sources_begin()
{&UpstreamProvider, "http://repo.almalinux.org/almalinux", FeedByPrelude},
{&UpstreamProvider, "http://repo.almalinux.org/almalinux", DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/almalinux", FeedByPrelude},
{&Volcengine, "https://mirrors.volces.com/almalinux", FeedByPrelude},
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/almalinux", FeedByPrelude},
@@ -35,7 +32,10 @@ os_almalinux_prelude ()
{&Nju, "https://mirror.nju.edu.cn/almalinux", FeedByPrelude}
def_sources_end()
chef_set_provider_speed_measure_url (&UpstreamProvider, "https://raw.repo.almalinux.org/almalinux/9.5/isos/x86_64/AlmaLinux-9-latest-x86_64-minimal.iso");
#define link "/9.6/isos/x86_64/AlmaLinux-9-latest-x86_64-minimal.iso"
chef_set_sources_speed_measure_url_with_postfix (this, link);
chef_set_provider_speed_measure_url (&UpstreamProvider, "https://raw.repo.almalinux.org/almalinux" link);
#undef link
}
/**
@@ -46,9 +46,9 @@ os_almalinux_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_almalinux);
chsrc_use_this_source (os_almalinux);
char *cmd = xy_strjoin (3,
char *cmd = xy_strcat (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#\\s*baseurl=https://repo.almalinux.org/almalinux|baseurl=", source.url, "|g' -i.bak /etc/yum.repos.d/almalinux*.repo");
chsrc_run (cmd, RunOpt_Default);

View File

@@ -7,17 +7,15 @@ def_target(os_anolis, "anolis/openanolis");
void
os_anolis_prelude ()
{
use_this(os_anolis);
chef_allow_s(os_anolis);
chef_prep_this (os_anolis, s);
chef_set_created_on (this, "2023-09-24");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-06-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, 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);
@@ -41,9 +39,9 @@ os_anolis_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_anolis);
chsrc_use_this_source (os_anolis);
char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
char *cmd = xy_strcat (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("dnf makecache", RunOpt_Default);

View File

@@ -7,20 +7,15 @@ def_target(os_fedora, "fedora");
void
os_fedora_prelude ()
{
use_this(os_fedora);
chef_allow_sr(os_fedora);
chef_prep_this (os_fedora, sr);
chef_set_created_on (this, "2023-09-26");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 2,
"Heng Guo", "2085471348@qq.com",
"happy game", "happygame1024@gmail.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 1, "happy game", "happygame1024@gmail.com");
chef_set_contributors (this, 1,
"Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, "@happy-game");
chef_set_cooks (this, 2, "@G_I_Y", "@happy-game");
chef_set_sauciers (this, 1, "@ccmywish");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -55,7 +50,7 @@ os_fedora_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_fedora);
chsrc_use_this_source (os_fedora);
chsrc_alert2 ("Fedora 38 及以下版本暂不支持");
@@ -63,7 +58,7 @@ os_fedora_setsrc (char *option)
chsrc_backup ("/etc/yum.repos.d/fedora-updates.repo");
// 取消对 baseurl 的注释
char* cmd = xy_strjoin (5, "sed ",
char* cmd = xy_strcat (5, "sed ",
"-i 's|^#baseurl=|baseurl=",
"|g' ",
"/etc/yum.repos.d/fedora.repo ",
@@ -73,7 +68,7 @@ os_fedora_setsrc (char *option)
// 替换
// (1) baseurl=<<URL>>/releases/...
// (2) baseurl=<<URL>>/updates/...
cmd = xy_strjoin (7, "sed ",
cmd = xy_strcat (7, "sed ",
"-i -E 's!^baseurl=.*?/(releases|updates)/!baseurl=",
source.url,
"/\\1/",

View File

@@ -7,18 +7,15 @@ def_target(os_rockylinux, "rocky/rockylinux");
void
os_rockylinux_prelude ()
{
use_this(os_rockylinux);
chef_allow_sr(os_rockylinux);
chef_prep_this (os_rockylinux, sr);
chef_set_created_on (this, "2023-09-24");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
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,
"happy game", "happygame1024@gmail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -49,7 +46,7 @@ os_rockylinux_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_rockylinux);
chsrc_use_this_source (os_rockylinux);
char *version_str = xy_run ("sed -nr 's/ROCKY_SUPPORT_PRODUCT_VERSION=\"(.*)\"/\\1/p' " ETC_OS_RELEASE, 0);
double version = atof (version_str);
@@ -58,7 +55,7 @@ os_rockylinux_setsrc (char *option)
if (version < 9)
{
cmd = xy_strjoin (3,
cmd = xy_strcat (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' "
"-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=", source.url, "|g' "
"-i.bak /etc/yum.repos.d/Rocky-*.repo"
@@ -70,7 +67,7 @@ os_rockylinux_setsrc (char *option)
}
else
{
cmd = xy_strjoin (3,
cmd = xy_strcat (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' "
"-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=", source.url, "|g' "
"-i.bak /etc/yum.repos.d/rocky-extras.repo /etc/yum.repos.d/rocky.repo"

View File

@@ -7,21 +7,15 @@ def_target(os_openeuler, "openeuler");
void
os_openeuler_prelude ()
{
use_this(os_openeuler);
chef_allow_gs(os_openeuler);
chef_prep_this (os_openeuler, gs);
chef_set_created_on (this, "2023-09-06");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 3,
"Aoran Zeng", "ccmywish@qq.com",
"Yangmoooo", "yangmoooo@outlook.com",
"happy game", "happygame1024@gmail.com");
chef_set_cooks (this, 1, "@G_I_Y");
chef_set_chef (this, NULL);
chef_set_sauciers (this, 3, "@ccmywish", "@Yangmoooo", "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -66,14 +60,14 @@ os_openeuler_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_openeuler);
chsrc_use_this_source (os_openeuler);
chsrc_backup (OS_openEuler_SourceList);
// 替换 baseurl=<<URL>>/openEuler-xx.xx/...
// openEuler-xx.xx 为 openEuler 版本号
// sed -E 's!^baseurl=.*?/openEuler-([^/]+)!baseurl=$(source.url)/openEuler-\1/!g' OS_openEuler_SourceList
char* cmd = xy_strjoin (6, "sed ",
char* cmd = xy_strcat (6, "sed ",
"-i -E 's!^baseurl=.*?/openEuler-([^/]+)!baseurl=",
source.url,
"openEuler-\\1",

View File

@@ -7,18 +7,15 @@ def_target(os_opensuse, "opensuse/opensuse-leap/opensuse-tumbleweed");
void
os_opensuse_prelude ()
{
use_this(os_opensuse);
chef_allow_s(os_opensuse);
chef_prep_this (os_opensuse, s);
chef_set_created_on (this, "2023-09-17");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 2, "@ccmywish", "@G_I_Y");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -46,7 +43,7 @@ os_opensuse_setsrc (char *option)
{
// chsrc_ensure_root ();
use_this_source(os_opensuse);
chsrc_use_this_source (os_opensuse);
while (1) {
chsrc_note2 ("请选择你的操作系统为:");

View File

@@ -10,19 +10,15 @@ def_target(os_arch, "arch/archlinux");
void
os_arch_prelude ()
{
use_this(os_arch);
chef_allow_gs(os_arch);
chef_prep_this (os_arch, gs);
chef_set_created_on (this, "2023-09-05");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com",
"Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 1, "happy game", "happygame1024@gmail.com");
chef_set_contributors (this, 1,
"happy game", "happygame1024@gmail.com");
chef_set_chef (this, "@happy-game");
chef_set_cooks (this, 2, "@ccmywish", "@G_I_Y");
chef_set_sauciers (this, 1, "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -70,7 +66,7 @@ os_arch_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_arch);
chsrc_use_this_source (os_arch);
chsrc_backup (OS_Pacman_MirrorList);
@@ -81,12 +77,12 @@ os_arch_setsrc (char *option)
if (strncmp(arch, "x86_64", 6)==0)
{
is_x86 = true;
to_write = xy_strjoin (3, "Server = ", source.url, "/$repo/os/$arch");
to_write = xy_strcat (3, "Server = ", source.url, "/$repo/os/$arch");
}
else
{
is_x86 = false;
to_write = xy_strjoin (3, "Server = ", source.url, "arm/$arch/$repo");
to_write = xy_strcat (3, "Server = ", source.url, "arm/$arch/$repo");
}
/* 配置文件中,越前面的优先级越高 */
@@ -116,18 +112,15 @@ def_target(os_archlinuxcn, "archlinuxcn/archcn");
void
os_archlinuxcn_prelude ()
{
use_this(os_archlinuxcn);
chef_allow_gs(os_archlinuxcn);
chef_prep_this (os_archlinuxcn, gs);
chef_set_created_on (this, "2023-09-05");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-07-03");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com", "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"happy game", "happygame1024@gmail.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 2, "@ccmywish", "@G_I_Y");
chef_set_sauciers (this, 1, "@happy-game");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -169,7 +162,7 @@ os_archlinuxcn_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(os_archlinuxcn);
chsrc_use_this_source (os_archlinuxcn);
chsrc_backup (OS_Pacman_ArchLinuxCN_MirrorList);
@@ -181,13 +174,13 @@ os_archlinuxcn_setsrc (char *option)
if (ret == 0)
{
char *sed_cmd = xy_strjoin (4, "sed -i '/\\[archlinuxcn\\]/{n;s|^Server = .*|Server = ",
char *sed_cmd = xy_strcat (4, "sed -i '/\\[archlinuxcn\\]/{n;s|^Server = .*|Server = ",
source.url, "$arch|;}' ", OS_Pacman_ArchLinuxCN_MirrorList);
chsrc_run (sed_cmd, RunOpt_Default);
}
else
{
char *archlinuxcn_config = xy_strjoin (3, "\n[archlinuxcn]\nServer = ", source.url, "$arch\n");
char *archlinuxcn_config = xy_strcat (3, "\n[archlinuxcn]\nServer = ", source.url, "$arch\n");
chsrc_append_to_file (archlinuxcn_config, OS_Pacman_ArchLinuxCN_MirrorList);
}

View File

@@ -7,18 +7,15 @@ def_target(os_msys2, "msys2/msys");
void
os_msys2_prelude ()
{
use_this(os_msys2);
chef_allow_s(os_msys2);
chef_prep_this (os_msys2, s);
chef_set_created_on (this, "2023-09-06");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_cooks (this, 0);
chef_set_contributors (this, 1,
"Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@G_I_Y");
chef_set_sauciers (this, 1, "@ccmywish");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -46,18 +43,18 @@ os_msys2_prelude ()
void
os_msys2_setsrc (char *option)
{
use_this_source(os_msys2);
chsrc_use_this_source (os_msys2);
chsrc_backup ("/etc/pacman.d/mirrorlist.mingw32");
chsrc_backup ("/etc/pacman.d/mirrorlist.mingw64");
chsrc_backup ("/etc/pacman.d/mirrorlist.msys");
char *prev = xy_strjoin (3, "请针对你的架构下载安装此目录下的文件:",
char *prev = xy_strcat (3, "请针对你的架构下载安装此目录下的文件:",
source.url,
"distrib/<架构>/");
chsrc_note2 (prev);
char *cmd = xy_strjoin (3, "sed -i \"s#https\?://mirror.msys2.org/#",
char *cmd = xy_strcat (3, "sed -i \"s#https\?://mirror.msys2.org/#",
source.url,
"#g\" /etc/pacman.d/mirrorlist* ");

View File

@@ -7,16 +7,14 @@ def_target(os_manjaro, "manjaro");
void
os_manjaro_prelude ()
{
use_this(os_manjaro);
chef_allow_s(os_manjaro);
chef_prep_this (os_manjaro, s);
chef_set_created_on (this, "2023-09-06");
chef_set_last_updated (this, "2025-08-10");
chef_set_authors (this, 1, "Heng Guo", "2085471348@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, "@G_I_Y");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);

View File

@@ -2,11 +2,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Name : recipe-template.c
* File Authors : Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org>
* File Authors : 曾奥然 <ccmywish@qq.com>
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
* |
* Created On : <2024-08-09>
* Last Modified : <2025-08-11>
* Last Modified : <2025-08-22>
* -------------------------------------------------------------
* 本文件作为一个通用模板:
*
@@ -58,29 +58,24 @@ RubyMetric = {
void
<category>_<target>_prelude (void)
{
use_this(<category>_<target>);
chef_allow_gsr(<category>_<target>);
// chef_allow_s(<category>_<target>);
// chef_allow_gs(<category>_<target>);
// chef_allow_sr(<category>_<target>);
// op 可以为 NOOP|s|sr|gsr|gs, 代表支持 Get Set Reset 三种操作
chef_prep_this (<category>_<target>, op);
chef_set_created_on (this, "2024-08-09");
chef_set_last_updated (this, "2025-08-12");
chef_set_sources_last_updated (this, "2025-08-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,
"Nil Null", "nil@null.org");
chef_set_created_on (this, "2024-08-09"); // 文件创建日期
chef_set_last_updated (this, "2025-08-12"); // 文件最后一次更新日期
chef_set_sources_last_updated (this, "2025-08-11"); // 镜像源最后一次更新日期
chef_set_chef (this, "@ccmywish"); // recipe 负责人
chef_set_cooks (this, 2, "@ccmywish", "@nilnull"); // recipe 核心作者
// 做了贡献?将自己的信息加在这里!
chef_set_sauciers (this, 2, "@nulnone", "@someone");
chef_allow_local_mode (this, PartiallyCan, "具体说明是否支持项目级换源...", "Tell users the local mode support");
// chef_allow_english(this);
// chef_allow_english(this); // 项目是否支持英文
chef_forbid_english(this);
// chef_allow_user_define(this);
// chef_allow_user_define(this); // 是否支持用户自定义镜像源
chef_forbid_user_define(this);
chef_set_note ("中文备注说明...", "English note...");
@@ -117,7 +112,7 @@ void
<category>_<target>_setsrc (char *option)
{
/* 下面这行是必须的,注入 source 变量 */
use_this_source(<category>_<target>);
chsrc_use_this_source (<category>_<target>);
/* 如果是 target group你可能想要指定不同的 target 来使用它的源 */
// Source_t source = chsrc_yield_source_and_confirm (&pl_js_group_target, option);
@@ -141,3 +136,7 @@ void
/* 往往统一在 _setsrc() 中实现,直接调用即可 */
// <category>_<target>_setsrc (option);
}
// 最后,请将自己的文件加入到 menu.c 和 chsrc-main.c 对应的位置
// 形式可以参考其附近的其他食谱

View File

@@ -9,19 +9,15 @@ def_target(wr_anaconda, "conda/anaconda");
void
wr_anaconda_prelude ()
{
use_this(wr_anaconda);
chef_allow_gs(wr_anaconda);
chef_prep_this (wr_anaconda, gs);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-08-09");
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, 2,
"Yangmoooo", "yangmoooo@outlook.com",
"yongxiang", "1926885268@qq.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 2, "@Yangmoooo", "@xyx1926885268");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -56,12 +52,12 @@ wr_anaconda_getsrc (char *option)
void
wr_anaconda_setsrc (char *option)
{
use_this_source(wr_anaconda);
chsrc_use_this_source (wr_anaconda);
char *w = xy_str_gsub (RAWSTR_wr_anaconda_condarc, "@1@", source.url);
/* Windows 也是在这里 */
char *configfile = xy_2strjoin (xy_os_home, "/.condarc");
char *configfile = xy_2strcat (xy_os_home, "/.condarc");
if (xy_on_windows)
{
@@ -78,7 +74,7 @@ wr_anaconda_setsrc (char *option)
}
}
chsrc_note2 (xy_strjoin (3, "请向 ", configfile, " 中手动添加:"));
chsrc_note2 (xy_strcat (3, "请向 ", configfile, " 中手动添加:"));
println (w);
chsrc_note2 ("然后运行 conda clean -i 清除索引缓存,保证用的是镜像站提供的索引");

View File

@@ -7,17 +7,15 @@ def_target(wr_cocoapods, "cocoa/cocoapods/cocoapod");
void
wr_cocoapods_prelude ()
{
use_this(wr_cocoapods);
chef_allow_s(wr_cocoapods);
chef_prep_this (wr_cocoapods, s);
chef_set_created_on (this, "2024-06-08");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-07-13");
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);
@@ -40,17 +38,17 @@ wr_cocoapods_prelude ()
void
wr_cocoapods_setsrc (char *option)
{
use_this_source(wr_cocoapods);
chsrc_use_this_source (wr_cocoapods);
chsrc_note2 ("请手动执行以下命令:");
p("cd ~/.cocoapods/repos");
p("pod repo remove master");
char *git_cmd = xy_strjoin (3, "git clone ", source.url, " master");
char *git_cmd = xy_strcat (3, "git clone ", source.url, " master");
p(git_cmd);
br();
chsrc_note2 ("最后进入项目工程目录在Podfile中第一行加入:");
char *source_str = xy_strjoin (3, "source '", source.url, "'");
char *source_str = xy_strcat (3, "source '", source.url, "'");
p(source_str);
chsrc_determine_chgtype (ChgType_Manual);

View File

@@ -24,19 +24,15 @@ def_target(wr_docker, "docker/dockerhub");
void
wr_docker_prelude ()
{
use_this(wr_docker);
chef_allow_gs(wr_docker);
chef_prep_this (wr_docker, gs);
chef_set_created_on (this, "2024-06-08");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-07-14");
chef_set_authors (this, 2,
"happy game", "happygame1024@gmail.com",
"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");
chef_set_cooks (this, 2, "@happy-game", "@ccmywish");
chef_set_sauciers (this, 0);
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -75,7 +71,7 @@ wr_docker_setsrc (char *option)
{
chsrc_ensure_root ();
use_this_source(wr_docker);
chsrc_use_this_source (wr_docker);
if (xy_on_linux || xy_on_bsd)
{
@@ -118,7 +114,7 @@ wr_docker_setsrc (char *option)
/* 不存在 /etc/docker/daemon.json 时可以直接写入文件 */
chsrc_alert2 ("未找到Docker配置文件, 将自动创建");
chsrc_ensure_dir ("/etc/docker");
chsrc_run ( xy_2strjoin ("touch ", WR_Docker_ConfigFile), RunOpt_Default);
chsrc_run ( xy_2strcat ("touch ", WR_Docker_ConfigFile), RunOpt_Default);
chsrc_append_to_file (to_add, WR_Docker_ConfigFile);
}

View File

@@ -14,17 +14,15 @@ def_target(wr_emacs, "emacs/elpa");
void
wr_emacs_prelude ()
{
use_this(wr_emacs);
chef_allow_s(wr_emacs);
chef_prep_this (wr_emacs, s);
chef_set_created_on (this, "2023-10-10");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-07-13");
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);
@@ -49,7 +47,7 @@ wr_emacs_prelude ()
void
wr_emacs_setsrc (char *option)
{
use_this_source(wr_emacs);
chsrc_use_this_source (wr_emacs);
chsrc_note2 ("Emacs换源涉及Elisp, 需要手动查阅并换源:");
p (source.url);

View File

@@ -7,18 +7,15 @@ def_target(wr_flatpak, "flatpak/flathub");
void
wr_flatpak_prelude ()
{
use_this(wr_flatpak);
chef_allow_gsr(wr_flatpak);
chef_prep_this (wr_flatpak, gsr);
chef_set_created_on (this, "2023-09-11");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-05-27");
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,
"Jialin Lyu", "jialinlvcn@aliyun.com");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@jialinlvcn");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -66,10 +63,10 @@ wr_flatpak_getsrc (char *option)
void
wr_flatpak_setsrc (char *option)
{
use_this_source(wr_flatpak);
chsrc_use_this_source (wr_flatpak);
chsrc_alert2 ("若出现问题,可先调用以下命令:");
char *note = xy_strjoin (3,
char *note = xy_strcat (3,
"wget ", source.url, "/flathub.gpg\n"
"flatpak remote-modify --gpg-import=flathub.gpg flathub"
);
@@ -80,7 +77,7 @@ wr_flatpak_setsrc (char *option)
"尝试运行 flatpak remote-modify flathub --url=https://flathub.org/repo";
say (repo_note);
char *cmd = xy_2strjoin ("flatpak remote-modify flathub --url=", source.url);
char *cmd = xy_2strcat ("flatpak remote-modify flathub --url=", source.url);
chsrc_run (cmd, RunOpt_Default);
chsrc_determine_chgtype (ChgType_Auto);

View File

@@ -7,17 +7,15 @@ def_target(wr_guix, "guix");
void
wr_guix_prelude ()
{
use_this(wr_guix);
chef_allow_s(wr_guix);
chef_prep_this (wr_guix, s);
chef_set_created_on (this, "2023-09-11");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-07-13");
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);
@@ -39,9 +37,9 @@ wr_guix_prelude ()
void
wr_guix_setsrc (char *option)
{
use_this_source(wr_guix);
chsrc_use_this_source (wr_guix);
char *file = xy_strjoin (3, "(list (channel\n"
char *file = xy_strcat (3, "(list (channel\n"
" (inherit (car %default-channels))\n"
" (url \"", source.url, "\")))");

View File

@@ -9,18 +9,15 @@ def_target(wr_homebrew, "brew/homebrew");
void
wr_homebrew_prelude ()
{
use_this(wr_homebrew);
chef_allow_gs(wr_homebrew);
chef_prep_this (wr_homebrew, gs);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-07-13");
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,
"Word2VecT", "tangzinan@bupt.edu.cn");
chef_set_chef (this, NULL);
chef_set_cooks (this, 1, "@ccmywish");
chef_set_sauciers (this, 1, "@Word2VecT");
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_allow_english(this);
@@ -43,7 +40,7 @@ void
wr_homebrew_getsrc (char *option)
{
int status = system (RAWSTR_wr_homebrew_read_config_cmd);
if (status != 0) { /* NOOP */ }
if (status != 0) { xy_noop(); }
}
/**
@@ -56,7 +53,7 @@ wr_homebrew_getsrc (char *option)
void
wr_homebrew_setsrc (char *option)
{
use_this_source(wr_homebrew);
chsrc_use_this_source (wr_homebrew);
char *w = xy_str_gsub (RAWSTR_wr_homebrew_config_in_bash, "@1@", source.url);

View File

@@ -7,17 +7,15 @@ def_target(wr_nix, "nix");
void
wr_nix_prelude ()
{
use_this(wr_nix);
chef_allow_s(wr_nix);
chef_prep_this (wr_nix, s);
chef_set_created_on (this, "2023-09-26");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-07-13");
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);
@@ -52,21 +50,21 @@ wr_nix_setsrc (char *option)
{
wr_nix_check_cmd ();
use_this_source(wr_nix);
chsrc_use_this_source (wr_nix);
char *cmd = xy_strjoin (3, "nix-channel --add ", source.url, "nixpkgs-unstable nixpkgs");
char *cmd = xy_strcat (3, "nix-channel --add ", source.url, "nixpkgs-unstable nixpkgs");
chsrc_run (cmd, RunOpt_Default);
char *w = xy_strjoin (3, "substituters = ", source.url, "store https://cache.nixos.org/");
char *w = xy_strcat (3, "substituters = ", source.url, "store https://cache.nixos.org/");
chsrc_append_to_file (w, "~/.config/nix/nix.conf");
chsrc_run ("nix-channel --update", RunOpt_Default);
chsrc_note2 ("若你使用的是NixOS请确认你的系统版本<version>如22.11),并手动运行:");
cmd = xy_strjoin (3, "nix-channel --add ", source.url, "nixpkgs-<version> nixpkgs");
cmd = xy_strcat (3, "nix-channel --add ", source.url, "nixpkgs-<version> nixpkgs");
p(cmd);
cmd = xy_strjoin (3, "nix.settings.substituters = [ \"", source.url, "store\" ];");
cmd = xy_strcat (3, "nix.settings.substituters = [ \"", source.url, "store\" ];");
chsrc_note2 ("若你使用的是NixOS请额外添加下述内容至 configuration.nix 中");
p(cmd);

View File

@@ -9,18 +9,15 @@ def_target(wr_tex, "latex/ctan/tex/texlive/miktex/tlmgr/mpm");
void
wr_tex_prelude ()
{
use_this(wr_tex);
chef_allow_gs(wr_tex);
chef_prep_this (wr_tex, gs);
chef_set_created_on (this, "2023-09-10");
chef_set_last_updated (this, "2025-08-09");
chef_set_sources_last_updated (this, "2025-07-28");
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, CanNot, NULL, NULL);
chef_forbid_english(this);
@@ -85,20 +82,20 @@ wr_tex_setsrc (char *option)
bool tlmgr_exist, mpm_exist;
wr_tex_check_cmd (&tlmgr_exist, &mpm_exist);
use_this_source(wr_tex);
chsrc_use_this_source (wr_tex);
char *cmd = NULL;
if (tlmgr_exist)
{
cmd = xy_2strjoin ("tlmgr option repository ", source.url);
cmd = xy_2strcat ("tlmgr option repository ", source.url);
chsrc_run (cmd, RunOpt_Default);
}
if (mpm_exist)
{
char *miktex_url = xy_2strjoin (xy_str_delete_suffix (source.url, "texlive/tlnet"), "win32/miktex/tm/packages/");
cmd = xy_2strjoin ("mpm --set-repository=", miktex_url);
char *miktex_url = xy_2strcat (xy_str_delete_suffix (source.url, "texlive/tlnet"), "win32/miktex/tm/packages/");
cmd = xy_2strcat ("mpm --set-repository=", miktex_url);
chsrc_run (cmd, RunOpt_Default);
}

View File

@@ -7,17 +7,15 @@ def_target(wr_winget, "winget");
void
wr_winget_prelude ()
{
use_this(wr_winget);
chef_allow_gsr(wr_winget);
chef_prep_this (wr_winget, gsr);
chef_set_created_on (this, "2024-06-07");
chef_set_last_updated (this, "2025-07-13");
chef_set_last_updated (this, "2025-08-17");
chef_set_sources_last_updated (this, "2025-07-13");
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, "@Mikachu2333");
chef_forbid_english(this);
chef_allow_user_define(this);
@@ -46,10 +44,13 @@ wr_winget_getsrc (char *option)
void
wr_winget_setsrc (char *option)
{
use_this_source(wr_winget);
chsrc_use_this_source (wr_winget);
chsrc_run ("winget source remove winget", RunOpt_Default);
chsrc_run (xy_strjoin (3, "winget source add winget ", source.url, " --trust-level trusted"), RunOpt_Default);
// 2025.8.17 此前用户可能隐式使用默认源导致 remove 失败,故使用 Dont_Abort
chsrc_run ("winget source remove winget", RunOpt_Dont_Abort_On_Failure);
// 2025.8.18 执行两次相同的命令后继续设置,无报错,换源成功。具体原因不明
chsrc_run ("winget source remove winget", RunOpt_Dont_Abort_On_Failure);
chsrc_run (xy_strcat (3, "winget source add winget ", source.url, " --trust-level trusted"), RunOpt_Default);
chsrc_determine_chgtype (ChgType_Auto);
chsrc_conclude (&source);