diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 506cd2c..8b533c3 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -71,7 +71,20 @@ #include "recipe/lang/Go.c" #include "recipe/lang/Java.c" +#include "recipe/lang/Rust/common.h" + #include "recipe/lang/Rust/rustup.c" + #include "recipe/lang/Rust/Cargo.c" +#include "recipe/lang/Dart/common.h" +#include "recipe/lang/Dart/Pub.c" +#include "recipe/lang/Dart/Flutter.c" + +#include "recipe/lang/Haskell.c" +#include "recipe/lang/OCaml.c" +#include "recipe/lang/R.c" +#include "recipe/lang/Julia.c" +#include "recipe/lang/NuGet.c" +#include "recipe/lang/Clojure.c" #include "rawstr4c.h" diff --git a/src/recipe/lang/Clojure.c b/src/recipe/lang/Clojure.c index 4ec7825..b355b2a 100644 --- a/src/recipe/lang/Clojure.c +++ b/src/recipe/lang/Clojure.c @@ -19,7 +19,7 @@ pl_clojure_prelude () chef_set_sous_chefs (this, 0); chef_set_contributors (this, 0); - chef_allow_local_mode (this, Can, NULL, NULL); + chef_allow_local_mode (this, FullyCan, NULL, NULL); chef_forbid_english(this); chef_allow_user_define(this); diff --git a/src/recipe/lang/Dart/Flutter.c b/src/recipe/lang/Dart/Flutter.c index 0336d02..21f90c0 100644 --- a/src/recipe/lang/Dart/Flutter.c +++ b/src/recipe/lang/Dart/Flutter.c @@ -2,8 +2,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later * ------------------------------------------------------------*/ -#define PL_Dart_Flutter_Speed_URL_Postfix "/flutter_infra_release/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz" - def_target(pl_dart_flutter); void @@ -27,20 +25,15 @@ pl_dart_flutter_prelude (void) chef_allow_english(this); chef_allow_user_define(this); - chef_set_note ("2024-09-14: 不得不将Dart和Flutter拆分为两个Target,因为3家教育网镜像站给出的 Dart 和 Flutter 换源URL模式都不一样", - "2024-09-14: Had to split Dart and Flutter into two Targets, because the 3 educational network mirror sites have different URL patterns for Dart and Flutter source switching"); - def_sources_begin() - {&upstream, "https://storage.googleapis.com", "https://storage.googleapis.com" PL_Dart_Flutter_Speed_URL_Postfix}, - {&FlutterCN, "https://storage.flutter-io.cn", DelegateToMirror}, - {&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn", NULL }, /* 官方文档也没有给后缀,怀疑是否存在问题 */ - - {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/flutter", - "https://mirrors.tuna.tsinghua.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix}, - - {&Nju, "https://mirror.nju.edu.cn/flutter", - "https://mirror.nju.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix} + {&upstream, "https://storage.googleapis.com", FeedByPrelude}, + {&FlutterCN, "https://storage.flutter-io.cn", FeedByPrelude}, + {&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn", FeedByPrelude }, /* 官方文档也没有给后缀,怀疑是否存在问题 */ + {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/flutter", FeedByPrelude}, + {&Nju, "https://mirror.nju.edu.cn/flutter", FeedByPrelude} def_sources_end() + + chsrc_set_sources_speed_measure_url_with_postfix (this, "/flutter_infra_release/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz"); } @@ -62,7 +55,7 @@ pl_dart_flutter_getsrc (char *option) void pl_dart_flutter_setsrc (char *option) { - chsrc_yield_source_and_confirm (pl_dart_flutter); + use_this_source(pl_dart_flutter); char *w = NULL; char *cmd = NULL; diff --git a/src/recipe/lang/Dart/Pub.c b/src/recipe/lang/Dart/Pub.c index a06aef6..34255e8 100644 --- a/src/recipe/lang/Dart/Pub.c +++ b/src/recipe/lang/Dart/Pub.c @@ -29,7 +29,7 @@ pl_dart_prelude (void) {&upstream, "https://pub.dev", FeedByPrelude}, {&FlutterCN, "https://pub.flutter-io.cn", FeedByPrelude}, {&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/dart-pub", FeedByPrelude}, - {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/dart-pub", FeedByPrelude, + {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/dart-pub", FeedByPrelude}, {&Nju, "https://mirror.nju.edu.cn/dart-pub", FeedByPrelude} def_sources_end() @@ -51,7 +51,7 @@ pl_dart_getsrc (char *option) void pl_dart_setsrc (char *option) { - chsrc_yield_source_and_confirm (pl_dart); + use_this_source(pl_dart); char *w = NULL; char *cmd = NULL; diff --git a/src/recipe/lang/Julia.c b/src/recipe/lang/Julia.c index ee71479..a5ca313 100644 --- a/src/recipe/lang/Julia.c +++ b/src/recipe/lang/Julia.c @@ -23,8 +23,6 @@ pl_julia_prelude () 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}, diff --git a/src/recipe/lang/NuGet.c b/src/recipe/lang/NuGet.c index bc3ebcb..a6effb9 100644 --- a/src/recipe/lang/NuGet.c +++ b/src/recipe/lang/NuGet.c @@ -23,8 +23,6 @@ pl_nuget_prelude () 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} @@ -39,6 +37,9 @@ pl_nuget_getsrc (char *option) } +/** + * 暂时未实现该换源功能,可参照 https://mirrors.huaweicloud.com/mirrorDetail/5ebf85de07b41baf6d0882ab?mirrorName=nuget&catalog=language + */ void pl_nuget_setsrc (char *option) { diff --git a/src/recipe/lang/R.c b/src/recipe/lang/R.c index 8579126..8166650 100644 --- a/src/recipe/lang/R.c +++ b/src/recipe/lang/R.c @@ -23,8 +23,7 @@ pl_r_prelude () chef_forbid_english(this); chef_allow_user_define(this); - chef_set_note ("以下注释的,是不含有bioconductor的镜像站,我们在换cran的同时,也直接帮助用户换bioconductor", NULL); - + // 以下注释的,是不含有bioconductor的镜像站,我们在换cran的同时,也直接帮助用户换bioconductor def_sources_begin() {&upstream, NULL, DelegateToUpstream}, {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/cran/", DelegateToMirror}, @@ -65,7 +64,7 @@ pl_r_getsrc (char *option) void pl_r_setsrc (char *option) { - chsrc_yield_source_and_confirm (pl_r); + 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"); diff --git a/src/recipe/lang/Rust/Cargo.c b/src/recipe/lang/Rust/Cargo.c index 42c83b3..2a91573 100644 --- a/src/recipe/lang/Rust/Cargo.c +++ b/src/recipe/lang/Rust/Cargo.c @@ -25,9 +25,8 @@ pl_rust_cargo_prelude (void) chef_forbid_english (this); chef_allow_user_define(this); - chef_set_note ("以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`。链接末尾的 `/` 不能缺少", - "All sources support sparse index, we will add `sparse+` by default when changing sources. The trailing `/` in URLs cannot be missing"); + // 以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`。链接末尾的 `/` 不能缺少 def_sources_begin() {&upstream, "https://crates.io/", "https://crates.io/api/v1/crates/windows/0.58.0/download"}, {&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/", DelegateToMirror}, diff --git a/src/recipe/lang/Rust/rustup.c b/src/recipe/lang/Rust/rustup.c index 2b00cff..b9152a3 100644 --- a/src/recipe/lang/Rust/rustup.c +++ b/src/recipe/lang/Rust/rustup.c @@ -42,7 +42,7 @@ pl_rust_rustup_prelude (void) def_sources_end() // 20MB大小 - chsrc_set_sources_speed_measure_url_with_postfix (this, "/dist/2025-06-26/cargo-1.88.0-x86_64-unknown-illumos.tar.gz") + chsrc_set_sources_speed_measure_url_with_postfix (this, "/dist/2025-06-26/cargo-1.88.0-x86_64-unknown-illumos.tar.gz"); }