mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-13 06:54:08 +08:00
Add support for rocky
Gitee close #I8025X
This commit is contained in:
parent
25e5155675
commit
9f3ef4060d
34
chsrc.c
34
chsrc.c
@ -1277,6 +1277,37 @@ os_gentoo_setsrc(char* option)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参考: https://help.mirrors.cernet.edu.cn/rocky/
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
os_rocky_setsrc (char* option)
|
||||||
|
{
|
||||||
|
ensure_root();
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
if (NULL!=option) {
|
||||||
|
index = lets_find_mirror(os_rocky, option);
|
||||||
|
} else {
|
||||||
|
index = lets_test_speed(os_rocky);
|
||||||
|
}
|
||||||
|
|
||||||
|
source_info source = os_rocky_sources[index];
|
||||||
|
chsrc_say_selection(&source);
|
||||||
|
|
||||||
|
char* cmd = xy_strjoin(3,
|
||||||
|
"sudo 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"
|
||||||
|
);
|
||||||
|
chsrc_runcmd(cmd);
|
||||||
|
chsrc_say_thanks(&source);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HELP: 未经测试
|
* HELP: 未经测试
|
||||||
*/
|
*/
|
||||||
@ -1906,6 +1937,7 @@ target_info
|
|||||||
os_arch_target = {os_arch_setsrc, NULL, os_arch_sources, os_arch_sources_n},
|
os_arch_target = {os_arch_setsrc, NULL, os_arch_sources, os_arch_sources_n},
|
||||||
os_manjaro_target = {os_manjaro_setsrc, NULL, NULL, 0},
|
os_manjaro_target = {os_manjaro_setsrc, NULL, NULL, 0},
|
||||||
os_gentoo_target = {os_gentoo_setsrc, NULL, os_gentoo_sources, os_gentoo_sources_n},
|
os_gentoo_target = {os_gentoo_setsrc, NULL, os_gentoo_sources, os_gentoo_sources_n},
|
||||||
|
os_rocky_target = {os_rocky_setsrc, NULL, os_rocky_sources, os_rocky_sources_n},
|
||||||
os_freebsd_target = {os_freebsd_setsrc, NULL, os_freebsd_sources, os_freebsd_sources_n},
|
os_freebsd_target = {os_freebsd_setsrc, NULL, os_freebsd_sources, os_freebsd_sources_n},
|
||||||
os_netbsd_target = {os_netbsd_setsrc, NULL, os_netbsd_sources, os_netbsd_sources_n},
|
os_netbsd_target = {os_netbsd_setsrc, NULL, os_netbsd_sources, os_netbsd_sources_n},
|
||||||
os_openbsd_target = {os_openbsd_setsrc, NULL, os_openbsd_sources, os_openbsd_sources_n},
|
os_openbsd_target = {os_openbsd_setsrc, NULL, os_openbsd_sources, os_openbsd_sources_n},
|
||||||
@ -1922,6 +1954,7 @@ static const char
|
|||||||
*os_arch [] = {"arch", NULL, targetinfo(&os_arch_target)},
|
*os_arch [] = {"arch", NULL, targetinfo(&os_arch_target)},
|
||||||
*os_manjaro [] = {"manjaro", NULL, targetinfo(&os_manjaro_target)},
|
*os_manjaro [] = {"manjaro", NULL, targetinfo(&os_manjaro_target)},
|
||||||
*os_gentoo [] = {"gentoo", NULL, targetinfo(&os_gentoo_target)},
|
*os_gentoo [] = {"gentoo", NULL, targetinfo(&os_gentoo_target)},
|
||||||
|
*os_rocky [] = {"rocky", "rockylinux", NULL, targetinfo(&os_rocky_target)},
|
||||||
*os_freebsd [] = {"freebsd", NULL, targetinfo(&os_freebsd_target)},
|
*os_freebsd [] = {"freebsd", NULL, targetinfo(&os_freebsd_target)},
|
||||||
*os_netbsd [] = {"netbsd", NULL, targetinfo(&os_netbsd_target)},
|
*os_netbsd [] = {"netbsd", NULL, targetinfo(&os_netbsd_target)},
|
||||||
*os_openbsd [] = {"openbsd", NULL, targetinfo(&os_openbsd_target)},
|
*os_openbsd [] = {"openbsd", NULL, targetinfo(&os_openbsd_target)},
|
||||||
@ -1932,6 +1965,7 @@ static const char
|
|||||||
{
|
{
|
||||||
os_ubuntu, os_debian, os_fedora, os_opensuse, os_kali,
|
os_ubuntu, os_debian, os_fedora, os_opensuse, os_kali,
|
||||||
os_arch, os_manjaro, os_gentoo,
|
os_arch, os_manjaro, os_gentoo,
|
||||||
|
os_rocky,
|
||||||
os_freebsd, os_netbsd, os_openbsd,
|
os_freebsd, os_netbsd, os_openbsd,
|
||||||
os_msys2,
|
os_msys2,
|
||||||
os_deepin, os_openeuler, os_openkylin,
|
os_deepin, os_openeuler, os_openkylin,
|
||||||
|
23
sources.h
23
sources.h
@ -430,6 +430,21 @@ os_kali_sources[] = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2023-09-24 更新
|
||||||
|
*/
|
||||||
|
os_rocky_sources[] = {
|
||||||
|
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rocky"},
|
||||||
|
{&Sustech, "https://mirrors.sustech.edu.cn/rocky-linux"},
|
||||||
|
{&Zju, "https://mirrors.zju.edu.cn/rocky"},
|
||||||
|
{&Lzuoss, "https://mirror.lzu.edu.cn/rocky"},
|
||||||
|
{&Sohu, "https://mirrors.sohu.com/Rocky"},
|
||||||
|
{&Netease, "https://mirrors.163.com/rocky"},
|
||||||
|
{&Ali, "https://mirrors.aliyun.com/rockylinux"},
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2023-09-02 更新
|
* 2023-09-02 更新
|
||||||
*
|
*
|
||||||
@ -673,10 +688,12 @@ def_target_sources_n(pl_ocaml);
|
|||||||
def_target_sources_n(pl_r); def_target_sources_n(pl_julia);
|
def_target_sources_n(pl_r); def_target_sources_n(pl_julia);
|
||||||
|
|
||||||
def_target_sources_n(os_ubuntu); def_target_sources_n(os_debian); def_target_sources_n(os_fedora);
|
def_target_sources_n(os_ubuntu); def_target_sources_n(os_debian); def_target_sources_n(os_fedora);
|
||||||
def_target_sources_n(os_kali); def_target_sources_n(os_openbsd); def_target_sources_n(os_msys2);
|
def_target_sources_n(os_kali); def_target_sources_n(os_opensuse);
|
||||||
def_target_sources_n(os_arch); def_target_sources_n(os_gentoo); def_target_sources_n(os_netbsd);
|
def_target_sources_n(os_arch); def_target_sources_n(os_gentoo); def_target_sources_n(os_rocky);
|
||||||
|
def_target_sources_n(os_msys2);
|
||||||
|
def_target_sources_n(os_freebsd); def_target_sources_n(os_netbsd); def_target_sources_n(os_openbsd);
|
||||||
def_target_sources_n(os_deepin); def_target_sources_n(os_openeuler); def_target_sources_n(os_openkylin);
|
def_target_sources_n(os_deepin); def_target_sources_n(os_openeuler); def_target_sources_n(os_openkylin);
|
||||||
def_target_sources_n(os_freebsd); def_target_sources_n(os_opensuse);
|
|
||||||
|
|
||||||
def_target_sources_n(wr_brew); def_target_sources_n(wr_flathub);
|
def_target_sources_n(wr_brew); def_target_sources_n(wr_flathub);
|
||||||
def_target_sources_n(wr_nix); def_target_sources_n(wr_guix);
|
def_target_sources_n(wr_nix); def_target_sources_n(wr_guix);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user