diff --git a/src/framework/struct.h b/src/framework/struct.h index 492d4ec..ad51b96 100644 --- a/src/framework/struct.h +++ b/src/framework/struct.h @@ -173,7 +173,5 @@ TargetRegisterInfo_t; /* 以下宏仅能放在 prelude() 中使用 */ #define use_this(t) Target_t *this = &t##_target; -#define def_sources_begin() Source_t sources[] = { +#define def_sources_begin() SourceProvider_t upstream = UpstreamProvider; Source_t sources[] = { #define def_sources_end() }; this->sources = sources; this->sources_n = xy_arylen(sources); - -#define def_upstream(url) SourceProvider_t upstream = UpstreamProvider; upstream.site = url; diff --git a/src/recipe/lang/Clojure.c b/src/recipe/lang/Clojure.c index 080f125..5abe4ae 100644 --- a/src/recipe/lang/Clojure.c +++ b/src/recipe/lang/Clojure.c @@ -1,26 +1,40 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-09-10> - * Last Modified : <2025-07-16> * ------------------------------------------------------------*/ -/** - * @update 2025-07-14 - */ -static Source_t pl_clojure_sources[] = +def_target(pl_clojure); + +void +pl_clojure_prelude () { - {&UpstreamProvider, NULL, NULL}, + use_this(pl_clojure); + + 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_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com"); + chef_set_chef (this, NULL, NULL); + chef_set_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_set(); + + chef_allow_local_mode (this, Can, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + def_sources_begin() + {&upstream, NULL, 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}, {&Nyist, "https://mirror.nyist.edu.cn/clojars/", DelegateToMirror}, {&Ustc, "https://mirrors.ustc.edu.cn/clojars/", DelegateToMirror}, {&Iscas, "https://mirror.iscas.ac.cn/clojars/", DelegateToMirror} -}; -def_sources_n(pl_clojure); + def_sources_end() +} void @@ -41,30 +55,5 @@ pl_clojure_setsrc (char *option) println (config); } - chsrc_determine_chgtype (ChgType_Manual); chsrc_conclude (&source); } - - -/** - * chsrc ls clojure - */ -Feature_t -pl_clojure_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = false; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NULL; - f.can_english = false; - - f.can_user_define = true; - - f.note = NULL; - return f; -} - -def_target_sf(pl_clojure); diff --git a/src/recipe/lang/Go.c b/src/recipe/lang/Go.c index a23b816..29a002a 100644 --- a/src/recipe/lang/Go.c +++ b/src/recipe/lang/Go.c @@ -1,53 +1,59 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : czyt -* | Rui Yang - * | - * Created On : <2023-08-30> - * Major Revision : 1 - * Last Modified : <2025-07-12> * ------------------------------------------------------------*/ -static SourceProvider_t pl_go_upstream = -{ - def_upstream, "https://pkg.go.dev/", - def_need_measure_info -}; - static MirrorSite_t GoProxyCN = { - IS_DedicatedMirrorSite, "goproxy.cn", "Goproxy.cn", "Goproxy.cn (七牛云)", "https://goproxy.cn/", - {NotSkip, NA, NA, "https://goproxy.cn/github.com/aws/aws-sdk-go/@v/v1.45.2.zip", ACCURATE} // 30 MB + "https://goproxy.cn/github.com/aws/aws-sdk-go/@v/v1.45.2.zip", // 30 MB + ACCURATE }, GoProxyIO = { - IS_DedicatedMirrorSite, "goproxy.io", "GOPROXY.IO", "GOPROXY.IO", "https://goproxy.io/", - {NotSkip, NA, NA, "https://goproxy.io/github.com/aws/aws-sdk-go/@v/v1.45.2.zip", ACCURATE} // 30 MB + "https://goproxy.io/github.com/aws/aws-sdk-go/@v/v1.45.2.zip", // 30 MB + ACCURATE }; +def_target(pl_go); -/** - * @update 2025-07-12 - * - * @note 缺少教育网软件源 - */ -static Source_t pl_go_sources[] = +void +pl_go_prelude () { - {&pl_go_upstream, "https://proxy.golang.org", NULL}, + use_this(pl_go); + + 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_sous_chefs (this, 0); + chef_set_contributors (this, 2, + "czyt", "czyt.go@gmail.com", + "Rui Yang", "techoc@foxmail.com"); + + chef_allow_get(); + chef_allow_set(); + chef_allow_reset(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + + def_sources_begin() + {&upstream, "https://proxy.golang.org", DelegateToUpstream}, {&GoProxyCN, "https://goproxy.cn", DelegateToMirror}, - {&Ali, "https://mirrors.aliyun.com/goproxy/", NULL}, + {&Ali, "https://mirrors.aliyun.com/goproxy/", DelegateToMirror}, // 暂时停用华为镜像源, 详见 https://github.com/RubyMetric/chsrc/issues/227 - // {&Huawei, "https://mirrors.huaweicloud.com/goproxy/", NULL}, + // {&Huawei, "https://mirrors.huaweicloud.com/goproxy/", DelegateToMirror}, {&GoProxyIO, "https://goproxy.io", DelegateToMirror} -}; -def_sources_n(pl_go); + def_sources_end() +} @@ -74,8 +80,6 @@ pl_go_getsrc (char *option) /** - * chsrc set go - * * @consult https://goproxy.cn/ */ void @@ -91,39 +95,12 @@ pl_go_setsrc (char *option) cmd = xy_strjoin (3, "go env -w GOPROXY=", source.url, ",direct"); chsrc_run (cmd, RunOpt_Default); - chsrc_determine_chgtype (ChgType_Auto); chsrc_conclude (&source); } -/** - * chsrc reset go - */ + void pl_go_resetsrc (char *option) { pl_go_setsrc (option); } - - -/** - * chsrc ls go - */ -Feature_t -pl_go_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = true; - - f.cap_locally = CanNot; - f.cap_locally_explain = NULL; - f.can_english = false; - - f.can_user_define = true; - - f.note = NULL; - return f; -} - -def_target_gsrf(pl_go); diff --git a/src/recipe/lang/Haskell.c b/src/recipe/lang/Haskell.c index cf58722..e485395 100644 --- a/src/recipe/lang/Haskell.c +++ b/src/recipe/lang/Haskell.c @@ -1,26 +1,40 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-09-10> - * Last Modified : <2025-07-22> * ------------------------------------------------------------*/ -/** - * @update 2023-09-10 - */ -static Source_t pl_haskell_sources[] = +def_target(pl_haskell); + +void +pl_haskell_prelude () { - {&UpstreamProvider, NULL, NULL}, + use_this(pl_haskell); + + 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_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com"); + chef_set_chef (this, NULL, NULL); + chef_set_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_set(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + def_sources_begin() + {&upstream, NULL, 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}, {&Ustc, "https://mirrors.ustc.edu.cn/hackage", DelegateToMirror}, {&Iscas, "https://mirror.iscas.ac.cn/hackage", DelegateToMirror}, {&Nyist, "https://mirror.nyist.edu.cn/hackage", DelegateToMirror} -}; -def_sources_n(pl_haskell); + def_sources_end() +} /** @@ -51,26 +65,5 @@ pl_haskell_setsrc (char *option) chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:")); println (content); - chsrc_determine_chgtype (ChgType_Manual); chsrc_conclude (&source); } - - -Feature_t -pl_haskell_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = false; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = false; - f.can_user_define = true; - - f.note = NULL; - return f; -} - -def_target_sf (pl_haskell); diff --git a/src/recipe/lang/Java.c b/src/recipe/lang/Java.c index e25a83a..1b03eff 100644 --- a/src/recipe/lang/Java.c +++ b/src/recipe/lang/Java.c @@ -1,31 +1,41 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : BingChunMoLi - * | - * Created On : <2023-08-31> - * Last Modified : <2025-07-31> * ------------------------------------------------------------*/ -static SourceProvider_t pl_java_upstream = -{ - def_upstream, "https://mvnrepository.com/", - def_need_measure_info -}; +def_target(pl_java); -/** - * @update 2024-12-18 - */ -static Source_t pl_java_sources[] = +void +pl_java_prelude () { - {&pl_java_upstream, "https://repo1.maven.org/maven2/", NULL}, + use_this(pl_java); + + 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_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "BingChunMoLi", "bingchunmoli@bingchunmoli.com"); + + chef_allow_get(); + chef_allow_set(); + chef_allow_reset(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + def_sources_begin() + {&upstream, "https://repo1.maven.org/maven2/", DelegateToUpstream}, {&Ali, "https://maven.aliyun.com/repository/public/", DelegateToMirror}, {&Huawei, "https://mirrors.huaweicloud.com/repository/maven/", DelegateToMirror}, - /* 网易的24小时更新一次 */ + + // 网易的24小时更新一次 {&Netease, "http://mirrors.163.com/maven/repository/maven-public/", DelegateToMirror} -}; -def_sources_n(pl_java); + def_sources_end() +} void @@ -93,7 +103,6 @@ pl_java_setsrc (char *option) println (file); } - chsrc_determine_chgtype (ChgType_Manual); chsrc_conclude (&source); } @@ -103,23 +112,3 @@ pl_java_resetsrc (char *option) { pl_java_setsrc (option); } - - -Feature_t -pl_java_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = true; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = false; - f.can_user_define = true; - - f.note = NULL; - return f; -} - -def_target_gsrf(pl_java); diff --git a/src/recipe/lang/Julia.c b/src/recipe/lang/Julia.c index 39b21e1..22b466b 100644 --- a/src/recipe/lang/Julia.c +++ b/src/recipe/lang/Julia.c @@ -1,23 +1,40 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-08-31> - * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ -/** - * @update 2025-07-14 - */ -static Source_t pl_julia_sources[] = +def_target(pl_julia); + +void +pl_julia_prelude () { - {&UpstreamProvider, NULL, NULL}, + use_this(pl_julia); + + 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_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com"); + chef_set_chef (this, NULL, NULL); + chef_set_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_get(); + chef_allow_set(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_allow_english(this); + chef_allow_user_define(this); + + chef_set_note ("Julia的换源可以通过两种方式: 1. 写入 startup.jl 2. 使用环境变量。我们采用第一种", NULL); + + def_sources_begin() + {&upstream, NULL, 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} -}; -def_sources_n(pl_julia); + def_sources_end() +} #define PL_Julia_Config "~/.julia/config/startup.jl" @@ -48,26 +65,5 @@ pl_julia_setsrc (char *option) chsrc_append_to_file (w, PL_Julia_Config); - chsrc_determine_chgtype (ChgType_Untested); chsrc_conclude (&source); } - - -Feature_t -pl_julia_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = true; - f.can_user_define = true; - - f.note = NULL; - return f; -} - -def_target_gsf(pl_julia); diff --git a/src/recipe/lang/Lua.c b/src/recipe/lang/Lua.c index 74b7368..c6c704c 100644 --- a/src/recipe/lang/Lua.c +++ b/src/recipe/lang/Lua.c @@ -1,30 +1,45 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-09-27> - * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ static MirrorSite_t Api7 = { - IS_DedicatedMirrorSite, "api7", "api7.ai", "深圳支流科技有限公司", "https://www.apiseven.com/", - {SKIP, ToFill, ToFill, NULL, ROUGH} + NULL, // no measure URL + ROUGH }; +def_target(pl_lua); -/** - * @update 2025-07-14 - * @note 目前只有一个源 - */ -static Source_t pl_lua_sources[] = +void +pl_lua_prelude () { - {&UpstreamProvider, NULL, NULL}, - {&Api7, "https://luarocks.cn", NULL}, -}; -def_sources_n(pl_lua); + use_this(pl_lua); + + 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_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com"); + chef_set_chef (this, NULL, NULL); + chef_set_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_get(); + chef_allow_set(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + chef_set_note ("目前只有一个源", NULL); + + def_sources_begin() + {&upstream, NULL, DelegateToUpstream}, + {&Api7, "https://luarocks.cn", DelegateToMirror} + def_sources_end() +} void @@ -55,26 +70,5 @@ pl_lua_setsrc (char *option) chsrc_note2 ("请手动修改 ~/.luarocks/upload_config.lua 文件 (用于上传):"); println (upload_config); - chsrc_determine_chgtype (ChgType_Manual); chsrc_conclude (&source); } - - -Feature_t -pl_lua_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = false; - f.can_user_define = true; - - f.note = NULL; - return f; -} - -def_target_gsf(pl_lua); diff --git a/src/recipe/lang/NuGet.c b/src/recipe/lang/NuGet.c index cf4bc92..2cd0405 100644 --- a/src/recipe/lang/NuGet.c +++ b/src/recipe/lang/NuGet.c @@ -1,33 +1,37 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-09-10> - * Last Modified : <2024-08-09> * ------------------------------------------------------------*/ -static MirrorSite_t NugetOrg = -{ - IS_UpstreamProvider, - "nuget.org", "NuGet Org", "Nuget Organization", "https://www.nuget.org/", - {SKIP, ToFill, ToFill, NULL, ROUGH} -}; +def_target(pl_nuget); -/** - * @update 2024-04-18 - * @note { - * 暂时未实现该换源功能,可参照 - * https://mirrors.huaweicloud.com/mirrorDetail/5ebf85de07b41baf6d0882ab?mirrorName=nuget&catalog=language - * } - */ -static Source_t pl_nuget_sources[] = +void +pl_nuget_prelude () { - {&UpstreamProvider, NULL, NULL}, - {&NugetOrg, "https://www.nuget.org/api/v2/", NULL}, + use_this(pl_nuget); + + 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_sous_chefs (this, 0); + chef_set_contributors (this, 0); + + chef_allow_get(); + chef_allow_set(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note ("暂时未实现该换源功能,可参照 https://mirrors.huaweicloud.com/mirrorDetail/5ebf85de07b41baf6d0882ab?mirrorName=nuget&catalog=language", NULL); + + def_sources_begin() + {&upstream, "https://www.nuget.org/api/v3/", DelegateToUpstream}, {&Huawei, "https://mirrors.huaweicloud.com/repository/nuget/v3", DelegateToMirror} -}; -def_sources_n(pl_nuget); + def_sources_end() +} void @@ -42,23 +46,3 @@ pl_nuget_setsrc (char *option) { chsrc_error ("暂时无法为NuGet换源,若有需求,请提交issue"); } - - -Feature_t -pl_nuget_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = false; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = false; - f.can_user_define = false; - - f.note = NULL; - return f; -} - -def_target_gsf(pl_nuget); diff --git a/src/recipe/lang/OCaml.c b/src/recipe/lang/OCaml.c index 2970802..b030952 100644 --- a/src/recipe/lang/OCaml.c +++ b/src/recipe/lang/OCaml.c @@ -1,21 +1,37 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-09-15> - * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ -/** - * @update 2025-07-14 - */ -static Source_t pl_ocaml_sources[] = +def_target(pl_ocaml); + +void +pl_ocaml_prelude () { - {&UpstreamProvider, NULL, NULL}, - {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/git/opam-repository.git", NULL} -}; -def_sources_n(pl_ocaml); + use_this(pl_ocaml); + + 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_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_get(); + chef_allow_set(); + chef_allow_reset(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + def_sources_begin() + {&upstream, NULL, DelegateToUpstream}, + {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/git/opam-repository.git", DelegateToMirror} + def_sources_end() +} void @@ -52,27 +68,5 @@ pl_ocaml_setsrc (char *option) chsrc_alert2 ("如果是首次使用 opam ,请使用以下命令进行初始化"); println (xy_2strjoin ("opam init default ", source.url)); - chsrc_determine_chgtype (ChgType_SemiAuto); chsrc_conclude (&source); } - - -Feature_t -pl_ocaml_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = false; - f.can_user_define = true; - - f.note = NULL; - return f; -} - - -def_target_gsf(pl_ocaml); diff --git a/src/recipe/lang/PHP.c b/src/recipe/lang/PHP.c index e5323d2..aa59d20 100644 --- a/src/recipe/lang/PHP.c +++ b/src/recipe/lang/PHP.c @@ -1,24 +1,40 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-08-30> - * Last Modified : <2025-07-31> * ------------------------------------------------------------*/ -/** - * @update 2024-09-14 - */ -static Source_t pl_php_sources[] = +def_target(pl_php); + +void +pl_php_prelude () { - {&UpstreamProvider, NULL, NULL}, + use_this(pl_php); + + 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_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_get(); + chef_allow_set(); + chef_allow_reset(); + + chef_allow_local_mode (this, Can, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + def_sources_begin() + {&upstream, NULL, DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/composer/", DelegateToMirror}, {&Tencent, "https://mirrors.tencent.com/composer/", DelegateToMirror}, // {&Tencent_Intra, "https://mirrors.tencentyun.com/composer/", DelegateToMirror}, {&Huawei, "https://mirrors.huaweicloud.com/repository/php/", DelegateToMirror} -}; -def_sources_n(pl_php); + def_sources_end() +} void @@ -56,25 +72,5 @@ pl_php_setsrc (char *option) char *cmd = xy_strjoin (4, "composer config", where, "repo.packagist composer ", source.url); chsrc_run (cmd, RunOpt_Default); - chsrc_determine_chgtype (ChgType_Auto); chsrc_conclude (&source); } - - -Feature_t -pl_php_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = false; - - f.cap_locally = FullyCan; - f.cap_locally_explain = "Support `composer`"; - f.can_english = false; - f.can_user_define = true; - - return f; -} - -def_target_gsf (pl_php); diff --git a/src/recipe/lang/Perl.c b/src/recipe/lang/Perl.c index 1fc976c..9d1faf9 100644 --- a/src/recipe/lang/Perl.c +++ b/src/recipe/lang/Perl.c @@ -1,33 +1,42 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * | - * Created On : <2023-09-31> - * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ -static SourceProvider_t pl_perl_upstream = -{ - def_upstream, "https://metacpan.org/", - def_need_measure_info -}; +def_target(pl_perl); -/** - * @update 2024-05-24 - */ -static Source_t pl_perl_sources[] = +void +pl_perl_prelude () { - {&pl_perl_upstream, NULL, NULL}, + use_this(pl_perl); + + 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_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com"); + chef_set_chef (this, NULL, NULL); + chef_set_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_get(); + chef_allow_set(); + chef_allow_reset(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + def_sources_begin() + {&upstream, NULL, 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}, {&Hust, "https://mirrors.hust.edu.cn/CPAN/", DelegateToMirror}, {&Ali, "https://mirrors.aliyun.com/CPAN/", DelegateToMirror}, {&Lzuoss, "https://mirror.lzu.edu.cn/CPAN/", DelegateToMirror} -}; -def_sources_n(pl_perl); + def_sources_end() +} void @@ -63,27 +72,5 @@ pl_perl_setsrc (char *option) chsrc_alert2 ("请使用 perl -v 以及 cpan -v,若 Perl >= v5.36 或 CPAN >= 2.29,请额外手动调用下面的命令"); p ("perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('pushy_https', 0);; CPAN::HandleConfig->commit()\""); - chsrc_determine_chgtype (ChgType_SemiAuto); chsrc_conclude (&source); } - - -Feature_t -pl_perl_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = false; - f.can_user_define = true; - - f.note = NULL; - return f; -} - - -def_target_gsf(pl_perl); diff --git a/src/recipe/lang/R.c b/src/recipe/lang/R.c index 45615b8..ecd7517 100644 --- a/src/recipe/lang/R.c +++ b/src/recipe/lang/R.c @@ -1,30 +1,44 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later - * ------------------------------------------------------------- - * File Authors : Aoran Zeng - * Contributors : Nil Null - * Created On : <2023-09-21> - * Last Modified : <2025-07-14> * ------------------------------------------------------------*/ -/** - * @update 2023-09-04 - * - * @note - * 以下注释的,是不含有bioconductor的镜像站, - * 我们在换cran的同时,也直接帮助用户换bioconductor - */ -static Source_t pl_r_sources[] = +def_target(pl_r); + +void +pl_r_prelude () { - {&UpstreamProvider, NULL, NULL}, + use_this(pl_r); + + 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_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com"); + chef_set_chef (this, NULL, NULL); + chef_set_sous_chefs (this, 0); + chef_set_contributors (this, 1, + "Nil Null", "nil@null.org"); + + chef_allow_get(); + chef_allow_set(); + chef_allow_reset(); + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_allow_user_define(this); + + chef_set_note ("以下注释的,是不含有bioconductor的镜像站,我们在换cran的同时,也直接帮助用户换bioconductor", NULL); + + def_sources_begin() + {&upstream, NULL, 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}, // {&Sustech, "https://mirrors.sustech.edu.cn/CRAN", DelegateToMirror}, // {&Bfsu, "https://mirrors.bfsu.edu.cn/CRAN/", DelegateToMirror}, // {&Bjtu, "https://mirror.bjtu.edu.cn/cran/", DelegateToMirror}, -}; -def_sources_n(pl_r); + def_sources_end() +} #define PL_R_Config_Windows "~/Documents/.Rprofile" @@ -71,26 +85,5 @@ pl_r_setsrc (char *option) chsrc_append_to_file (w, config); - chsrc_determine_chgtype (ChgType_Auto); chsrc_conclude (&source); } - - -Feature_t -pl_r_feat (char *option) -{ - Feature_t f = {0}; - - f.can_get = true; - f.can_reset = false; - - f.cap_locally = CanNot; - f.cap_locally_explain = NA; - f.can_english = false; - f.can_user_define = false; - - f.note = NULL; - return f; -} - -def_target_gsf(pl_r); diff --git a/src/recipe/os/APT/Armbian.c b/src/recipe/os/APT/Armbian.c index 041d068..5d62e98 100644 --- a/src/recipe/os/APT/Armbian.c +++ b/src/recipe/os/APT/Armbian.c @@ -30,7 +30,6 @@ os_armbian_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://apt.armbian.com"); def_sources_begin() {&upstream, "http://apt.armbian.com", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/armbian", DelegateToMirror}, diff --git a/src/recipe/os/APT/Debian.c b/src/recipe/os/APT/Debian.c index 715fd5d..ee94224 100644 --- a/src/recipe/os/APT/Debian.c +++ b/src/recipe/os/APT/Debian.c @@ -34,7 +34,6 @@ os_debian_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://deb.debian.org/debian"); def_sources_begin() {&upstream, "http://deb.debian.org/debian", DelegateToUpstream}, diff --git a/src/recipe/os/APT/Kali-Linux.c b/src/recipe/os/APT/Kali-Linux.c index fa88528..f31fea7 100644 --- a/src/recipe/os/APT/Kali-Linux.c +++ b/src/recipe/os/APT/Kali-Linux.c @@ -30,7 +30,6 @@ os_kali_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://http.kali.org/kali"); def_sources_begin() {&upstream, "http://http.kali.org/kali", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/kali", DelegateToMirror}, diff --git a/src/recipe/os/APT/Linux-Lite.c b/src/recipe/os/APT/Linux-Lite.c index 3ab205a..a0b9fd8 100644 --- a/src/recipe/os/APT/Linux-Lite.c +++ b/src/recipe/os/APT/Linux-Lite.c @@ -29,7 +29,6 @@ os_linuxlite_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://repo.linuxliteos.com/linuxlite/"); def_sources_begin() {&upstream, "http://repo.linuxliteos.com/linuxlite/", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/linuxliteos/", DelegateToMirror}, diff --git a/src/recipe/os/APT/Linux-Mint.c b/src/recipe/os/APT/Linux-Mint.c index 0669c30..25877a0 100644 --- a/src/recipe/os/APT/Linux-Mint.c +++ b/src/recipe/os/APT/Linux-Mint.c @@ -29,7 +29,6 @@ os_linuxmint_prelude () /* @note 实际上镜像站里的内容和Ubuntu的不太一样 */ - def_upstream("http://packages.linuxmint.com"); def_sources_begin() {&upstream, "http://packages.linuxmint.com", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/linuxmint/", DelegateToMirror}, diff --git a/src/recipe/os/APT/ROS.c b/src/recipe/os/APT/ROS.c index adb358f..76c4093 100644 --- a/src/recipe/os/APT/ROS.c +++ b/src/recipe/os/APT/ROS.c @@ -30,7 +30,6 @@ os_ros_prelude () chef_set_note(this, "该换源方案中,URL存在拼凑,因此不能手动使用某URL来换源", "In this switching method, URLs are constructed, so manual URL specification is not supported"); - def_upstream("http://packages.ros.org"); def_sources_begin() {&upstream, "http://packages.ros.org", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com", DelegateToMirror}, diff --git a/src/recipe/os/APT/Raspberry-Pi-OS.c b/src/recipe/os/APT/Raspberry-Pi-OS.c index 8623023..f844cd1 100644 --- a/src/recipe/os/APT/Raspberry-Pi-OS.c +++ b/src/recipe/os/APT/Raspberry-Pi-OS.c @@ -31,7 +31,6 @@ os_raspberrypi_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://archive.raspberrypi.com/"); def_sources_begin() // https://archive.raspberrypi.org/ until Debian "bullseye" release {&upstream, "https://archive.raspberrypi.com/", DelegateToUpstream}, diff --git a/src/recipe/os/APT/Termux.c b/src/recipe/os/APT/Termux.c index 6641952..fa32ff5 100644 --- a/src/recipe/os/APT/Termux.c +++ b/src/recipe/os/APT/Termux.c @@ -29,7 +29,6 @@ os_termux_prelude () chef_set_note(this, "该 recipe 存在对应的 bootstrapper", "This recipe has a corresponding bootstrapper"); - def_upstream("https://packages.termux.org/apt/termux-main/"); def_sources_begin() {&upstream, "https://packages.termux.org/apt/termux-main/", DelegateToUpstream}, {&Ustc, "https://mirrors.ustc.edu.cn/termux/", DelegateToMirror}, diff --git a/src/recipe/os/APT/Trisquel.c b/src/recipe/os/APT/Trisquel.c index ea49f4a..c622672 100644 --- a/src/recipe/os/APT/Trisquel.c +++ b/src/recipe/os/APT/Trisquel.c @@ -31,7 +31,6 @@ os_trisquel_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://archive.trisquel.info/trisquel/"); def_sources_begin() {&upstream, "http://archive.trisquel.info/trisquel/", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/trisquel/", DelegateToMirror}, diff --git a/src/recipe/os/APT/Ubuntu.c b/src/recipe/os/APT/Ubuntu.c index d511746..f644bac 100644 --- a/src/recipe/os/APT/Ubuntu.c +++ b/src/recipe/os/APT/Ubuntu.c @@ -33,7 +33,6 @@ os_ubuntu_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://archive.ubuntu.com/ubuntu/"); def_sources_begin() {&upstream, "http://archive.ubuntu.com/ubuntu/", /* 不支持https */ DelegateToUpstream}, diff --git a/src/recipe/os/APT/deepin.c b/src/recipe/os/APT/deepin.c index e39806b..de4cb38 100644 --- a/src/recipe/os/APT/deepin.c +++ b/src/recipe/os/APT/deepin.c @@ -29,7 +29,6 @@ os_deepin_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://community-packages.deepin.com/deepin"); def_sources_begin() {&upstream, "https://community-packages.deepin.com/deepin", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/deepin", DelegateToMirror}, diff --git a/src/recipe/os/APT/openKylin.c b/src/recipe/os/APT/openKylin.c index 7fb70fb..a2d5ba2 100644 --- a/src/recipe/os/APT/openKylin.c +++ b/src/recipe/os/APT/openKylin.c @@ -32,7 +32,6 @@ os_openkylin_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://archive.openkylin.top/openkylin/"); def_sources_begin() {&upstream, "https://archive.openkylin.top/openkylin/", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/openkylin/", DelegateToMirror}, diff --git a/src/recipe/os/Alpine-Linux.c b/src/recipe/os/Alpine-Linux.c index 9f1eb72..742d9a8 100644 --- a/src/recipe/os/Alpine-Linux.c +++ b/src/recipe/os/Alpine-Linux.c @@ -29,7 +29,6 @@ os_alpine_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://dl-cdn.alpinelinux.org/alpine"); def_sources_begin() {&upstream, "http://dl-cdn.alpinelinux.org/alpine", DelegateToUpstream}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/alpine", DelegateToMirror}, diff --git a/src/recipe/os/BSD/FreeBSD.c b/src/recipe/os/BSD/FreeBSD.c index 63010c6..a4f6c8f 100644 --- a/src/recipe/os/BSD/FreeBSD.c +++ b/src/recipe/os/BSD/FreeBSD.c @@ -27,8 +27,6 @@ os_freebsd_prelude () chef_set_note ("2023-09-24: 以下三个USTC, NJU, Netease 均维护了 freebsd-pkg freebsd-ports\n2023-09-27: 请务必保持Nju前面有至少一个镜像,原因请查看 freebsd 的换源函数", NULL); - def_upstream (NULL); - def_sources_begin() {&upstream, NULL, DelegateToUpstream}, {&Ustc, "mirrors.ustc.edu.cn", DelegateToMirror}, diff --git a/src/recipe/os/BSD/NetBSD.c b/src/recipe/os/BSD/NetBSD.c index 707eb67..b9435a0 100644 --- a/src/recipe/os/BSD/NetBSD.c +++ b/src/recipe/os/BSD/NetBSD.c @@ -28,8 +28,6 @@ os_netbsd_prelude () chef_set_note ("根据 @ykla: NetBSD 默认状态下没有 pkgsrc,用户可能安装了也可能没安装", NULL); - def_upstream (NULL); - def_sources_begin() {&upstream, NULL, DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/pkgsrc/packages/NetBSD/", DelegateToMirror}, diff --git a/src/recipe/os/BSD/OpenBSD.c b/src/recipe/os/BSD/OpenBSD.c index 99efa16..4c919c8 100644 --- a/src/recipe/os/BSD/OpenBSD.c +++ b/src/recipe/os/BSD/OpenBSD.c @@ -26,8 +26,6 @@ os_openbsd_prelude () chef_forbid_english(this); chef_forbid_user_define(this); - def_upstream (NULL); - def_sources_begin() {&upstream, NULL, DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/OpenBSD/", DelegateToMirror}, diff --git a/src/recipe/os/Gentoo-Linux.c b/src/recipe/os/Gentoo-Linux.c index a8fc64f..3947486 100644 --- a/src/recipe/os/Gentoo-Linux.c +++ b/src/recipe/os/Gentoo-Linux.c @@ -29,7 +29,6 @@ os_gentoo_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://www.gentoo.org/downloads/mirrors/"); def_sources_begin() {&upstream, "rsync://rsync.gentoo.org/gentoo-portage", DelegateToUpstream}, {&Ali, "mirrors.aliyun.com", DelegateToMirror}, diff --git a/src/recipe/os/OpenWrt.c b/src/recipe/os/OpenWrt.c index 9d90c23..c7bb9c3 100644 --- a/src/recipe/os/OpenWrt.c +++ b/src/recipe/os/OpenWrt.c @@ -30,7 +30,6 @@ os_openwrt_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://downloads.openwrt.org"); def_sources_begin() {&upstream, "https://downloads.openwrt.org", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/openwrt", DelegateToMirror}, diff --git a/src/recipe/os/Solus.c b/src/recipe/os/Solus.c index 5207ab8..f6fd365 100644 --- a/src/recipe/os/Solus.c +++ b/src/recipe/os/Solus.c @@ -29,7 +29,6 @@ os_solus_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://packages.getsol.us/"); def_sources_begin() {&upstream, "https://packages.getsol.us/shannon/eopkg-index.xml.xz", DelegateToUpstream}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/solus/packages/shannon/eopkg-index.xml.xz", DelegateToMirror}, diff --git a/src/recipe/os/Void-Linux.c b/src/recipe/os/Void-Linux.c index 6bad74a..381061c 100644 --- a/src/recipe/os/Void-Linux.c +++ b/src/recipe/os/Void-Linux.c @@ -29,7 +29,6 @@ os_voidlinux_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://repo-default.voidlinux.org"); def_sources_begin() {&upstream, "https://repo-default.voidlinux.org", DelegateToUpstream}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/voidlinux", DelegateToMirror}, diff --git a/src/recipe/os/YUM/AlmaLinux.c b/src/recipe/os/YUM/AlmaLinux.c index e4cb383..a8ae24e 100644 --- a/src/recipe/os/YUM/AlmaLinux.c +++ b/src/recipe/os/YUM/AlmaLinux.c @@ -27,7 +27,6 @@ os_almalinux_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://repo.almalinux.org/almalinux"); def_sources_begin() {&upstream, "http://repo.almalinux.org/almalinux", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/almalinux", DelegateToMirror}, diff --git a/src/recipe/os/YUM/Anolis-OS.c b/src/recipe/os/YUM/Anolis-OS.c index 3ffe24e..cafe7a2 100644 --- a/src/recipe/os/YUM/Anolis-OS.c +++ b/src/recipe/os/YUM/Anolis-OS.c @@ -27,7 +27,6 @@ os_anolis_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://mirrors.openanolis.cn/anolis"); def_sources_begin() {&upstream, "https://mirrors.openanolis.cn/anolis", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/anolis", DelegateToMirror}, diff --git a/src/recipe/os/YUM/Fedora-Linux.c b/src/recipe/os/YUM/Fedora-Linux.c index d5dd040..c6641d0 100644 --- a/src/recipe/os/YUM/Fedora-Linux.c +++ b/src/recipe/os/YUM/Fedora-Linux.c @@ -30,7 +30,6 @@ os_fedora_prelude () chef_set_note(this, NULL, NULL); - def_upstream("http://download.example/pub/fedora/linux"); def_sources_begin() {&upstream, "http://download.example/pub/fedora/linux", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/fedora", DelegateToMirror}, diff --git a/src/recipe/os/YUM/Rocky-Linux.c b/src/recipe/os/YUM/Rocky-Linux.c index ee11e74..05b77d2 100644 --- a/src/recipe/os/YUM/Rocky-Linux.c +++ b/src/recipe/os/YUM/Rocky-Linux.c @@ -26,7 +26,6 @@ os_rockylinux_prelude () chef_forbid_english(this); chef_forbid_user_define(this); - def_upstream ("https://dl.rockylinux.org/"); def_sources_begin() {&upstream, "https://dl.rockylinux.org", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/rocky", DelegateToMirror}, diff --git a/src/recipe/os/YUM/openEuler.c b/src/recipe/os/YUM/openEuler.c index 7f0dd88..7668237 100644 --- a/src/recipe/os/YUM/openEuler.c +++ b/src/recipe/os/YUM/openEuler.c @@ -30,7 +30,6 @@ os_openeuler_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://repo.openeuler.org/"); def_sources_begin() {&upstream, "https://repo.openeuler.org/", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/openeuler/", DelegateToMirror}, diff --git a/src/recipe/os/openSUSE.c b/src/recipe/os/openSUSE.c index 256aada..6436f92 100644 --- a/src/recipe/os/openSUSE.c +++ b/src/recipe/os/openSUSE.c @@ -29,7 +29,6 @@ os_opensuse_prelude () chef_set_note(this, NULL, NULL); - def_upstream("https://download.opensuse.org/"); def_sources_begin() {&upstream, "https://download.opensuse.org/", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/opensuse", DelegateToMirror}, diff --git a/src/recipe/os/pacman/Arch-Linux.c b/src/recipe/os/pacman/Arch-Linux.c index d006b97..26b7c78 100644 --- a/src/recipe/os/pacman/Arch-Linux.c +++ b/src/recipe/os/pacman/Arch-Linux.c @@ -32,11 +32,11 @@ os_arch_prelude () chef_set_note ("可额外使用 chsrc set archlinuxcn 来更换 Arch Linux CN Repository 源", "You can additionally use chsrc set archlinuxcn to change Arch Linux CN Repository source"); - def_upstream (NULL); /** * @note 不要给后面加 / ,因为ARM情况下,还要额外加一个 arm 后缀 */ def_sources_begin() + {&upstream, "https://repo.archlinux.org", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/archlinux", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn/archlinux", DelegateToMirror}, {&Ustc, "https://mirrors.ustc.edu.cn/archlinux", DelegateToMirror}, @@ -137,13 +137,9 @@ os_archlinuxcn_prelude () chef_set_note ("可额外使用 chsrc set arch 来更换 Arch Linux 源", "You can additionally use chsrc set arch to change Arch Linux source"); - def_upstream ("https://repo.archlinuxcn.org/"); - /** - * @note 根据 @zheng7fu2 建议,拆分 archlinuxcn 出来 - */ def_sources_begin() - {&upstream, NULL, DelegateToUpstream}, + {&upstream, "https://repo.archlinuxcn.org/", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/archlinuxcn/", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn/archlinuxcn/", DelegateToMirror}, {&Ustc, "https://mirrors.ustc.edu.cn/archlinuxcn/", DelegateToMirror}, @@ -156,12 +152,14 @@ os_archlinuxcn_prelude () def_sources_end() } + void os_archlinuxcn_getsrc (char *option) { chsrc_view_file (OS_Pacman_MirrorList); } + /** * @consult https://mirrors.tuna.tsinghua.edu.cn/help/archlinuxcn/ * @update 2025-05-24 diff --git a/src/recipe/os/pacman/MSYS2.c b/src/recipe/os/pacman/MSYS2.c index b7f1ba1..dbab9ee 100644 --- a/src/recipe/os/pacman/MSYS2.c +++ b/src/recipe/os/pacman/MSYS2.c @@ -25,8 +25,6 @@ os_msys2_prelude () chef_forbid_english(this); chef_forbid_user_define(this); - def_upstream (NULL); - def_sources_begin() {&upstream, NULL, DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/msys2", DelegateToMirror}, diff --git a/src/recipe/os/pacman/Manjaro-Linux.c b/src/recipe/os/pacman/Manjaro-Linux.c index 272c6b8..17eac0a 100644 --- a/src/recipe/os/pacman/Manjaro-Linux.c +++ b/src/recipe/os/pacman/Manjaro-Linux.c @@ -24,8 +24,6 @@ os_manjaro_prelude () chef_forbid_english(this); chef_forbid_user_define(this); - def_upstream (NULL); - def_sources_begin() {&upstream, NULL, DelegateToUpstream} /* Manjaro uses GUI tool, no manual sources needed */ diff --git a/src/recipe/recipe-template.c b/src/recipe/recipe-template.c index 2ae3a83..eab3975 100644 --- a/src/recipe/recipe-template.c +++ b/src/recipe/recipe-template.c @@ -76,7 +76,6 @@ void chef_set_note ("备注说明...", "Note..."); - def_upstream("https://github.com/RubyMetric/chsrc"); def_sources_begin() {&upstream, "上游地址,若维护者暂时未知,可填NULL,这个主要用于reset", DelegateToUpstream} {&RubyMetric, "https://rubymetirc.com/target", DelegateToMirror}, diff --git a/src/recipe/ware/Anaconda/Anaconda.c b/src/recipe/ware/Anaconda/Anaconda.c index 9b69081..1a634f8 100644 --- a/src/recipe/ware/Anaconda/Anaconda.c +++ b/src/recipe/ware/Anaconda/Anaconda.c @@ -30,7 +30,6 @@ wr_anaconda_prelude () chef_forbid_english(this); chef_forbid_user_define(this); - def_upstream("https://repo.anaconda.com"); def_sources_begin() {&upstream, "https://repo.anaconda.com", DelegateToUpstream}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn", DelegateToMirror}, diff --git a/src/recipe/ware/CocoaPods.c b/src/recipe/ware/CocoaPods.c index 9ca34fd..f401eff 100644 --- a/src/recipe/ware/CocoaPods.c +++ b/src/recipe/ware/CocoaPods.c @@ -27,7 +27,6 @@ wr_cocoapods_prelude () chef_forbid_english(this); chef_allow_user_define(this); - def_upstream("https://github.com/CocoaPods/Specs.git"); def_sources_begin() {&upstream, "https://github.com/CocoaPods/Specs.git", DelegateToUpstream}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git", DelegateToMirror}, diff --git a/src/recipe/ware/Docker-Hub/Docker-Hub.c b/src/recipe/ware/Docker-Hub/Docker-Hub.c index bdf3fa5..1bdded4 100644 --- a/src/recipe/ware/Docker-Hub/Docker-Hub.c +++ b/src/recipe/ware/Docker-Hub/Docker-Hub.c @@ -46,7 +46,6 @@ wr_dockerhub_prelude () chef_forbid_english(this); chef_allow_user_define(this); - def_upstream("https://hub.docker.com/"); def_sources_begin() {&upstream, "https://hub.docker.com/", DelegateToUpstream}, {&DaoCloud, "https://docker.m.daocloud.io", DelegateToMirror}, diff --git a/src/recipe/ware/Emacs.c b/src/recipe/ware/Emacs.c index 2db949c..27e0514 100644 --- a/src/recipe/ware/Emacs.c +++ b/src/recipe/ware/Emacs.c @@ -37,7 +37,6 @@ wr_emacs_prelude () chef_set_note (this, "Emacs用户往往只需要一次性换源,只会极少次调用 chsrc,我们只给用户提供文档", "Emacs users typically only need to switch sources once and rarely call chsrc, so we only provide documentation to users"); - def_upstream("https://elpa.gnu.org/"); def_sources_begin() {&upstream, "https://elpa.gnu.org/", DelegateToUpstream}, {&MirrorZ, "https://help.mirrors.cernet.edu.cn/elpa/", DelegateToMirror}, diff --git a/src/recipe/ware/Flathub.c b/src/recipe/ware/Flathub.c index defde2c..52bec35 100644 --- a/src/recipe/ware/Flathub.c +++ b/src/recipe/ware/Flathub.c @@ -30,7 +30,6 @@ wr_flathub_prelude () chef_set_note (this, "对Flathub目标进行测速的文件非常小,测速效果严重失真,若你知道可供测速的URL,欢迎参与贡献: chsrc issue", "The test file for Flathub is very small, causing inaccurate speed test results. If you know a URL suitable for speed testing, welcome to contribute: chsrc issue"); - def_upstream("https://flathub.org/repo"); def_sources_begin() {&upstream, "https://flathub.org/repo", DelegateToUpstream}, {&Sjtug_Siyuan, "https://mirror.sjtu.edu.cn/flathub", DelegateToMirror}, diff --git a/src/recipe/ware/Guix.c b/src/recipe/ware/Guix.c index 521742e..7b19f45 100644 --- a/src/recipe/ware/Guix.c +++ b/src/recipe/ware/Guix.c @@ -30,7 +30,6 @@ wr_guix_prelude () chef_set_note (this, "目前只有一个源, guixcn 的源不知道是否可用", "Currently only one source available, guixcn source availability unknown"); - def_upstream("https://git.savannah.gnu.org/git/guix.git"); def_sources_begin() {&upstream, "https://git.savannah.gnu.org/git/guix.git", DelegateToUpstream}, {&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/git/guix.git", DelegateToMirror} diff --git a/src/recipe/ware/Homebrew/Homebrew.c b/src/recipe/ware/Homebrew/Homebrew.c index 7273bda..2f67f34 100644 --- a/src/recipe/ware/Homebrew/Homebrew.c +++ b/src/recipe/ware/Homebrew/Homebrew.c @@ -32,7 +32,6 @@ wr_homebrew_prelude () chef_set_note (this, "该换源通过写入环境变量实现,若多次换源,请手动清理profile文件", "This source switching is implemented by writing environment variables. If switching sources multiple times, please manually clean the profile file"); - def_upstream("https://github.com/Homebrew/brew.git"); def_sources_begin() {&upstream, "https://github.com/Homebrew/brew.git", DelegateToUpstream}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/", DelegateToMirror}, diff --git a/src/recipe/ware/Nix.c b/src/recipe/ware/Nix.c index 27c9ccc..2c9a2fe 100644 --- a/src/recipe/ware/Nix.c +++ b/src/recipe/ware/Nix.c @@ -27,7 +27,6 @@ wr_nix_prelude () chef_forbid_english(this); chef_forbid_user_define(this); - def_upstream("https://channels.nixos.org/"); def_sources_begin() {&upstream, "https://channels.nixos.org/", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/nix-channels/", DelegateToMirror}, diff --git a/src/recipe/ware/TeX-Live.c b/src/recipe/ware/TeX-Live.c index 249e24a..8d961d2 100644 --- a/src/recipe/ware/TeX-Live.c +++ b/src/recipe/ware/TeX-Live.c @@ -29,7 +29,6 @@ wr_tex_prelude () chef_forbid_english(this); chef_allow_user_define(this); - def_upstream("https://ctan.org/tex-archive/systems/texlive/tlnet"); def_sources_begin() {&upstream, "https://ctan.org/tex-archive/systems/texlive/tlnet", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet", DelegateToMirror}, diff --git a/src/recipe/ware/WinGet.c b/src/recipe/ware/WinGet.c index b69637b..7d0f434 100644 --- a/src/recipe/ware/WinGet.c +++ b/src/recipe/ware/WinGet.c @@ -25,7 +25,6 @@ wr_winget_prelude () chef_forbid_english(this); chef_allow_user_define(this); - def_upstream("https://github.com/microsoft/winget-cli/"); def_sources_begin() {&upstream, "https://cdn.winget.microsoft.com/cache", NULL}, {&MirrorZ, "https://mirrors.cernet.edu.cn/winget-source", NULL},