diff --git a/src/recipe/os/APT/Armbian.c b/src/recipe/os/APT/Armbian.c index f237332..041d068 100644 --- a/src/recipe/os/APT/Armbian.c +++ b/src/recipe/os/APT/Armbian.c @@ -24,8 +24,14 @@ os_armbian_prelude () chef_allow_set(); chef_allow_reset(); + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, NULL, NULL); + def_upstream("http://apt.armbian.com"); - def_sources_begin(os_armbian) + def_sources_begin() {&upstream, "http://apt.armbian.com", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/armbian", DelegateToMirror}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/armbian", DelegateToMirror}, diff --git a/src/recipe/os/APT/Kali-Linux.c b/src/recipe/os/APT/Kali-Linux.c index f2379b1..fa88528 100644 --- a/src/recipe/os/APT/Kali-Linux.c +++ b/src/recipe/os/APT/Kali-Linux.c @@ -24,8 +24,14 @@ os_kali_prelude () chef_allow_set(); chef_allow_reset(); + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, NULL, NULL); + def_upstream("http://http.kali.org/kali"); - def_sources_begin(os_kali) + def_sources_begin() {&upstream, "http://http.kali.org/kali", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/kali", DelegateToMirror}, {&Ali, "https://mirrors.aliyun.com/kali", DelegateToMirror}, diff --git a/src/recipe/os/APT/Linux-Lite.c b/src/recipe/os/APT/Linux-Lite.c index 33e3dd1..3ab205a 100644 --- a/src/recipe/os/APT/Linux-Lite.c +++ b/src/recipe/os/APT/Linux-Lite.c @@ -23,8 +23,14 @@ os_linuxlite_prelude () chef_allow_set(); chef_allow_reset(); + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, NULL, NULL); + def_upstream("http://repo.linuxliteos.com/linuxlite/"); - def_sources_begin(os_linuxlite) + def_sources_begin() {&upstream, "http://repo.linuxliteos.com/linuxlite/", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/linuxliteos/", DelegateToMirror}, {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/linuxliteos/", DelegateToMirror}, diff --git a/src/recipe/os/APT/Linux-Mint.c b/src/recipe/os/APT/Linux-Mint.c index c47a84a..0669c30 100644 --- a/src/recipe/os/APT/Linux-Mint.c +++ b/src/recipe/os/APT/Linux-Mint.c @@ -23,9 +23,14 @@ os_linuxmint_prelude () chef_allow_set(); chef_allow_reset(); + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + /* @note 实际上镜像站里的内容和Ubuntu的不太一样 */ def_upstream("http://packages.linuxmint.com"); - def_sources_begin(os_linuxmint) + def_sources_begin() {&upstream, "http://packages.linuxmint.com", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/linuxmint/", DelegateToMirror}, {&Ali, "http://mirrors.aliyun.com/linuxmint-packages/", DelegateToMirror}, @@ -51,6 +56,7 @@ os_linuxmint_getsrc (char *option) chsrc_view_file (OS_LinuxMint_SourceList); } + /** * @consult https://help.mirrors.cernet.edu.cn/linuxmint/ */ @@ -79,7 +85,3 @@ os_linuxmint_setsrc (char *option) chsrc_warn2 ("完成后请不要再使用 mintsources(自带的图形化软件源设置工具)进行任何操作,因为在操作后,无论是否有按“确定”,mintsources 均会覆写我们刚才换源的内容"); chsrc_warn2 ("已自动更换mint主要源, 但mint也使用基于debian或ubuntu的基础源, 可参考对应的debian或ubuntu换源方法进行手动换源"); } - - - - diff --git a/src/recipe/os/APT/ROS.c b/src/recipe/os/APT/ROS.c index 0aa1305..adb358f 100644 --- a/src/recipe/os/APT/ROS.c +++ b/src/recipe/os/APT/ROS.c @@ -24,10 +24,14 @@ os_ros_prelude () chef_allow_set(); chef_allow_reset(); - this.note = "该换源方案中,URL存在拼凑,因此不能手动使用某URL来换源"; + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + 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(os_ros) + def_sources_begin() {&upstream, "http://packages.ros.org", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn", DelegateToMirror}, diff --git a/src/recipe/os/APT/Raspberry-Pi-OS.c b/src/recipe/os/APT/Raspberry-Pi-OS.c index 9984cff..8623023 100644 --- a/src/recipe/os/APT/Raspberry-Pi-OS.c +++ b/src/recipe/os/APT/Raspberry-Pi-OS.c @@ -1,5 +1,7 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later + * ------------------------------------------------------------- + * Raspberry Pi OS 树莓派操作系统,以前称为 Raspbian * ------------------------------------------------------------*/ def_target(os_raspberrypi); @@ -23,9 +25,14 @@ os_raspberrypi_prelude () chef_allow_set(); chef_allow_reset(); - /* Raspberry Pi OS 树莓派操作系统,以前称为 Raspbian */ + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, NULL, NULL); + def_upstream("https://archive.raspberrypi.com/"); - def_sources_begin(os_raspberrypi) + def_sources_begin() // https://archive.raspberrypi.org/ until Debian "bullseye" release {&upstream, "https://archive.raspberrypi.com/", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/raspberrypi/", DelegateToMirror}, @@ -70,6 +77,3 @@ os_raspberrypi_resetsrc (char *option) { os_raspberrypi_setsrc (option); } - - - diff --git a/src/recipe/os/APT/Termux.c b/src/recipe/os/APT/Termux.c index b14e625..6641952 100644 --- a/src/recipe/os/APT/Termux.c +++ b/src/recipe/os/APT/Termux.c @@ -22,10 +22,15 @@ os_termux_prelude () chef_allow_get(); chef_allow_set(); chef_allow_reset(); - this.note = "该 recipe 存在对应的 bootstrapper"; + + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, "该 recipe 存在对应的 bootstrapper", "This recipe has a corresponding bootstrapper"); def_upstream("https://packages.termux.org/apt/termux-main/"); - def_sources_begin(os_termux) + def_sources_begin() {&upstream, "https://packages.termux.org/apt/termux-main/", DelegateToUpstream}, {&Ustc, "https://mirrors.ustc.edu.cn/termux/", DelegateToMirror}, {&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/termux/", DelegateToMirror}, diff --git a/src/recipe/os/APT/Trisquel.c b/src/recipe/os/APT/Trisquel.c index af6ceba..ea49f4a 100644 --- a/src/recipe/os/APT/Trisquel.c +++ b/src/recipe/os/APT/Trisquel.c @@ -1,5 +1,7 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later + * ------------------------------------------------------------- + * Trisquel基于Ubuntu开发,不含任何专有软件及专有固件,内核使用 Linux-libre * ------------------------------------------------------------*/ def_target(os_trisquel); @@ -23,9 +25,14 @@ os_trisquel_prelude () chef_allow_set(); chef_allow_reset(); - /* Trisquel基于Ubuntu开发,不含任何专有软件及专有固件,内核使用 Linux-libre */ + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, NULL, NULL); + def_upstream("http://archive.trisquel.info/trisquel/"); - def_sources_begin(os_trisquel) + def_sources_begin() {&upstream, "http://archive.trisquel.info/trisquel/", DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/trisquel/", DelegateToMirror}, {&Ali, "https://mirrors.aliyun.com/trisquel/", DelegateToMirror}, diff --git a/src/recipe/os/APT/Ubuntu.c b/src/recipe/os/APT/Ubuntu.c index 944ffec..d511746 100644 --- a/src/recipe/os/APT/Ubuntu.c +++ b/src/recipe/os/APT/Ubuntu.c @@ -2,6 +2,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * ------------------------------------------------------------*/ +#define OS_Ubuntu_Speed_URL_Postfix "/dists/noble/Contents-amd64.gz" + def_target(os_ubuntu); void @@ -25,22 +27,16 @@ os_ubuntu_prelude () chef_allow_set(); chef_allow_reset(); -#define OS_Ubuntu_Speed_URL_Postfix "/dists/noble/Contents-amd64.gz" + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); -static SourceProvider_t os_ubuntu_upstream = -{ - def_upstream, "http://archive.ubuntu.com/", - // https://github.com/RubyMetric/chsrc/issues/121 - {NotSkip, NA, NA, "http://archive.ubuntu.com/ubuntu/dists/noble/Contents-amd64.gz", /* 48.9 MB*/ ACCURATE} -}; + chef_set_note(this, NULL, NULL); -/** - * @update 2025-07-11 - */ -static Source_t os_ubuntu_sources[] = -{ - {&os_ubuntu_upstream, "http://archive.ubuntu.com/ubuntu/", /* 不支持https */ - DelegateToUpstream}, + def_upstream("http://archive.ubuntu.com/ubuntu/"); + def_sources_begin() + {&upstream, "http://archive.ubuntu.com/ubuntu/", /* 不支持https */ + DelegateToUpstream}, {&MirrorZ, "https://mirrors.cernet.edu.cn/ubuntu/", "https://mirrors.cernet.edu.cn/ubuntu/" OS_Ubuntu_Speed_URL_Postfix }, @@ -60,6 +56,7 @@ static Source_t os_ubuntu_sources[] = {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/ubuntu", "https://mirrors.tuna.tsinghua.edu.cn/ubuntu" OS_Ubuntu_Speed_URL_Postfix}, + {&Tencent, "https://mirrors.tencent.com/ubuntu", {&Tencent, "https://mirrors.tencent.com/ubuntu", "https://mirrors.tencent.com/ubuntu" OS_Ubuntu_Speed_URL_Postfix}, @@ -67,7 +64,7 @@ static Source_t os_ubuntu_sources[] = // "https://mirrors.tencentyun.com/ubuntu" OS_Ubuntu_Speed_URL_Postfix}, {&Huawei, "https://mirrors.huaweicloud.com/ubuntu", - "https://mirrors.huaweicloud.com/ubuntu" OS_Ubuntu_Speed_URL_Postfix}, + "https://mirrors.huaweicloud.com/ubuntu" OS_Ubuntu_Speed_URL_Postfix} /* 不启用原因:过慢 */ // {&Netease, "https://mirrors.163.com/ubuntu", @@ -76,8 +73,10 @@ static Source_t os_ubuntu_sources[] = /* 不启用原因:过慢 */ // {&Sohu, "https://mirrors.sohu.com/ubuntu", // "https://mirrors.sohu.com/ubuntu" OS_Ubuntu_Speed_URL_Postfix} -}; -def_sources_n(os_ubuntu); + def_sources_end() + + chsrc_set_provider_speed_measure_url (&upstream, "http://archive.ubuntu.com/ubuntu/dists/noble/Contents-amd64.gz"); +} void diff --git a/src/recipe/os/APT/deepin.c b/src/recipe/os/APT/deepin.c index efc9894..e39806b 100644 --- a/src/recipe/os/APT/deepin.c +++ b/src/recipe/os/APT/deepin.c @@ -23,8 +23,14 @@ os_deepin_prelude () chef_allow_set(); chef_allow_reset(); + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, NULL, NULL); + def_upstream("https://community-packages.deepin.com/deepin"); - def_sources_begin(os_deepin) + def_sources_begin() {&upstream, "https://community-packages.deepin.com/deepin", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/deepin", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn/deepin", DelegateToMirror}, diff --git a/src/recipe/os/APT/openKylin.c b/src/recipe/os/APT/openKylin.c index 814101f..7fb70fb 100644 --- a/src/recipe/os/APT/openKylin.c +++ b/src/recipe/os/APT/openKylin.c @@ -1,5 +1,8 @@ /** ------------------------------------------------------------ * SPDX-License-Identifier: GPL-3.0-or-later + * ------------------------------------------------------------- + * openKylin直接基于Linux内核开发,属于和Debian、openSUSE、Fedora、Arch + * 同一级别的、根社区发布的系统 * ------------------------------------------------------------*/ def_target(os_openkylin); @@ -23,10 +26,14 @@ os_openkylin_prelude () chef_allow_set(); chef_allow_reset(); - /* openKylin直接基于Linux内核开发,属于和Debian、openSUSE、Fedora、Arch - * 同一级别的、根社区发布的系统 */ + chef_allow_local_mode (this, CanNot, NULL, NULL); + chef_forbid_english(this); + chef_forbid_user_define(this); + + chef_set_note(this, NULL, NULL); + def_upstream("https://archive.openkylin.top/openkylin/"); - def_sources_begin(os_openkylin) + def_sources_begin() {&upstream, "https://archive.openkylin.top/openkylin/", DelegateToUpstream}, {&Ali, "https://mirrors.aliyun.com/openkylin/", DelegateToMirror}, {&Netease, "https://mirrors.163.com/openkylin/", DelegateToMirror}