mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-29 14:25:07 +08:00
Qualify os family name
This commit is contained in:
44
src/recipe/os/YUM/AlmaLinux.c
Normal file
44
src/recipe/os/YUM/AlmaLinux.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Contributors : Nil Null <nil@null.org>
|
||||
* Created On : <2024-06-12>
|
||||
* Last Modified : <2024-08-16>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @time 2024-06-12 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
os_almalinux_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/almalinux"},
|
||||
{&Volcengine, "https://mirrors.volces.com/almalinux"},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/almalinux"},
|
||||
{&Zju, "https://mirrors.zju.edu.cn/almalinux"},
|
||||
{&Nju, "https://mirror.nju.edu.cn/almalinux"},
|
||||
};
|
||||
def_sources_n(os_almalinux);
|
||||
|
||||
/**
|
||||
* 参考: https://developer.aliyun.com/mirror/almalinux
|
||||
*/
|
||||
void
|
||||
os_almalinux_setsrc (char *option)
|
||||
{
|
||||
chsrc_ensure_root ();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_almalinux);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *cmd = xy_strjoin (3,
|
||||
"sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#\\s*baseurl=https://repo.almalinux.org/almalinux|baseurl=", source.url, "|g' -i.bak /etc/yum.repos.d/almalinux*.repo");
|
||||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
|
||||
chsrc_say_lastly (&source, ChsrcTypeAuto);
|
||||
}
|
||||
|
||||
def_target_s(os_almalinux);
|
||||
Reference in New Issue
Block a user