mirror of
https://github.com/RubyMetric/chsrc
synced 2025-08-13 15:59:32 +08:00
Update APT recipes using chef DSL
This commit is contained in:
parent
e36bdffaff
commit
4829ada7d8
@ -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},
|
||||
|
@ -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},
|
||||
|
@ -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},
|
||||
|
@ -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换源方法进行手动换源");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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},
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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},
|
||||
|
@ -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},
|
||||
|
@ -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
|
||||
|
@ -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},
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user