mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-01-22 19:24:06 +08:00
parent
94b3c15781
commit
10d376885c
|
@ -6,7 +6,7 @@
|
||||||
* Contributors : Shengwei Chen <414685209@qq.com>
|
* Contributors : Shengwei Chen <414685209@qq.com>
|
||||||
* |
|
* |
|
||||||
* Created on : <2023-08-29>
|
* Created on : <2023-08-29>
|
||||||
* Last modified : <2024-08-17>
|
* Last modified : <2024-08-22>
|
||||||
*
|
*
|
||||||
* 镜像站与换源信息
|
* 镜像站与换源信息
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
|
@ -163,6 +163,7 @@ typedef struct TargetInfo_t {
|
||||||
|
|
||||||
// 大部分target还不支持reset,所以暂时先默认设置为NULL来过渡
|
// 大部分target还不支持reset,所以暂时先默认设置为NULL来过渡
|
||||||
#define def_target(t) TargetInfo t##_target = {def_target_inner_gs(t),def_target_sourcesn(t)}
|
#define def_target(t) TargetInfo t##_target = {def_target_inner_gs(t),def_target_sourcesn(t)}
|
||||||
|
#define def_target_gs(t) TargetInfo t##_target = {def_target_inner_gs(t),def_target_sourcesn(t)}
|
||||||
#define def_target_gsr(t) TargetInfo t##_target = {def_target_inner_gsr(t),def_target_sourcesn(t)}
|
#define def_target_gsr(t) TargetInfo t##_target = {def_target_inner_gsr(t),def_target_sourcesn(t)}
|
||||||
#define def_target_gsf(t) TargetInfo t##_target = {def_target_inner_gsf(t),def_target_sourcesn(t)}
|
#define def_target_gsf(t) TargetInfo t##_target = {def_target_inner_gsf(t),def_target_sourcesn(t)}
|
||||||
#define def_target_gsrf(t) TargetInfo t##_target = {def_target_inner_gsrf(t),def_target_sourcesn(t)}
|
#define def_target_gsrf(t) TargetInfo t##_target = {def_target_inner_gsrf(t),def_target_sourcesn(t)}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Contributors : Nil Null <nil@null.org>
|
* Contributors : Nil Null <nil@null.org>
|
||||||
* Created On : <2023-09-24>
|
* Created On : <2023-09-24>
|
||||||
* Last Modified : <2024-08-16>
|
* Last Modified : <2024-08-22>
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
static SourceInfo
|
static SourceInfo
|
||||||
os_rockylinux_sources[] = {
|
os_rockylinux_sources[] = {
|
||||||
{&Upstream, NULL},
|
{&Upstream, NULL},
|
||||||
|
{&MirrorZ, "https://mirrors.cernet.edu.cn/rocky"},
|
||||||
{&Ali, "https://mirrors.aliyun.com/rockylinux"},
|
{&Ali, "https://mirrors.aliyun.com/rockylinux"},
|
||||||
{&Volcengine, "https://mirrors.volces.com/rockylinux"},
|
{&Volcengine, "https://mirrors.volces.com/rockylinux"},
|
||||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rocky"},
|
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rocky"},
|
||||||
|
@ -35,14 +36,39 @@ os_rockylinux_setsrc (char *option)
|
||||||
|
|
||||||
chsrc_yield_source_and_confirm (os_rockylinux);
|
chsrc_yield_source_and_confirm (os_rockylinux);
|
||||||
|
|
||||||
char *cmd = xy_strjoin (3,
|
|
||||||
"sed -e 's|^mirrorlist=|#mirrorlist=|g' "
|
char *version_str = xy_run ("sed -nr 's/ROCKY_SUPPORT_PRODUCT_VERSION=(.*)/\\1/p' " ETC_os_release, 0, NULL);
|
||||||
"-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=", source.url, "|g' "
|
version_str = xy_str_delete_suffix (version_str, "\n");
|
||||||
"-i.bak /etc/yum.repos.d/rocky-extras.repo /etc/yum.repos.d/rocky.repo"
|
double version = atof (version_str);
|
||||||
);
|
|
||||||
|
char *cmd = NULL;
|
||||||
|
|
||||||
|
if (version < 9)
|
||||||
|
{
|
||||||
|
cmd = xy_strjoin (3,
|
||||||
|
"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-*.repo"
|
||||||
|
);
|
||||||
|
// Rocky-AppStream.repo
|
||||||
|
// Rocky-BaseOS.repo
|
||||||
|
// Rocky-Extras
|
||||||
|
// Rocky-PowerTools
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmd = xy_strjoin (3,
|
||||||
|
"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_run (cmd, RunOpt_Default);
|
chsrc_run (cmd, RunOpt_Default);
|
||||||
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
|
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
|
||||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def_target_s(os_rockylinux);
|
def_target_s(os_rockylinux);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user