Update YUM recipes using chef DSL

This commit is contained in:
Aoran Zeng 2025-08-10 13:15:58 +08:00
parent 4829ada7d8
commit 4d10023993
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
5 changed files with 203 additions and 112 deletions

View File

@ -1,28 +1,44 @@
chef_set_created_on ("2024-06-12"); /** ------------------------------------------------------------
chef_set_authors ("Aoran Zeng <ccmywish@qq.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("Yangmoooo <yangmoooo@outlook.com>"); * ------------------------------------------------------------*/
chef_allow_set();
use_this;
static SourceProvider_t os_almalinux_upstream = def_target(os_almalinux);
{
def_upstream, "http://repo.almalinux.org/almalinux",
{NotSkip, NA, NA, "https://raw.repo.almalinux.org/almalinux/9.5/isos/x86_64/AlmaLinux-9-latest-x86_64-minimal.iso", ACCURATE}
};
/** void
* @update 2024-12-18 os_almalinux_prelude ()
*/
static Source_t os_almalinux_sources[] =
{ {
{&os_almalinux_upstream , "http://repo.almalinux.org/almalinux", DelegateToUpstream}, use_this(os_almalinux);
{&Ali, "https://mirrors.aliyun.com/almalinux", DelegateToMirror},
{&Volcengine, "https://mirrors.volces.com/almalinux", DelegateToMirror}, chef_set_created_on (this, "2024-06-12");
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/almalinux", DelegateToMirror}, chef_set_last_updated (this, "2025-08-10");
{&Zju, "https://mirrors.zju.edu.cn/almalinux", DelegateToMirror}, chef_set_sources_last_updated (this, "2024-12-18");
{&Nju, "https://mirror.nju.edu.cn/almalinux", DelegateToMirror},
}; chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
def_sources_n(os_almalinux); chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 1,
"Yangmoooo", "yangmoooo@outlook.com");
chef_allow_set();
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.almalinux.org/almalinux");
def_sources_begin()
{&upstream, "http://repo.almalinux.org/almalinux", DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/almalinux", DelegateToMirror},
{&Volcengine, "https://mirrors.volces.com/almalinux", DelegateToMirror},
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/almalinux", DelegateToMirror},
{&Zju, "https://mirrors.zju.edu.cn/almalinux", DelegateToMirror},
{&Nju, "https://mirror.nju.edu.cn/almalinux", DelegateToMirror}
def_sources_end()
chsrc_set_provider_speed_measure_url (&upstream, "https://raw.repo.almalinux.org/almalinux/9.5/isos/x86_64/AlmaLinux-9-latest-x86_64-minimal.iso");
}
/** /**
* @consult: https://developer.aliyun.com/mirror/almalinux * @consult: https://developer.aliyun.com/mirror/almalinux
@ -32,7 +48,8 @@ os_almalinux_setsrc (char *option)
{ {
chsrc_ensure_root (); chsrc_ensure_root ();
chsrc_yield_source_and_confirm (os_almalinux); use_this(os_almalinux);
Source_t source = chsrc_yield_source_and_confirm (this, option);
char *cmd = xy_strjoin (3, 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"); "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");
@ -43,6 +60,3 @@ os_almalinux_setsrc (char *option)
chsrc_determine_chgtype (ChgType_Auto); chsrc_determine_chgtype (ChgType_Auto);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
def_target(os_almalinux);

View File

@ -1,19 +1,39 @@
chef_set_created_on ("2023-09-24"); /** ------------------------------------------------------------
chef_set_authors ("Aoran Zeng <ccmywish@qq.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("Nil Null <nil@null.org>"); * ------------------------------------------------------------*/
chef_allow_set();
use_this;
/** def_target(os_anolis);
* @update 2024-06-12
*/ void
static Source_t os_anolis_sources[] = os_anolis_prelude ()
{ {
{&UpstreamProvider, NULL, NULL}, use_this(os_anolis);
{&Ali, "https://mirrors.aliyun.com/anolis", DelegateToMirror},
{&Hust, "https://mirrors.hust.edu.cn/anolis", DelegateToMirror} chef_set_created_on (this, "2023-09-24");
}; chef_set_last_updated (this, "2025-08-10");
def_sources_n(os_anolis); chef_set_sources_last_updated (this, "2024-06-12");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 1,
"Nil Null", "nil@null.org");
chef_allow_set();
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://mirrors.openanolis.cn/anolis");
def_sources_begin()
{&upstream, "https://mirrors.openanolis.cn/anolis", DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/anolis", DelegateToMirror},
{&Hust, "https://mirrors.hust.edu.cn/anolis", DelegateToMirror}
def_sources_end()
}
/** /**
@ -24,7 +44,8 @@ os_anolis_setsrc (char *option)
{ {
chsrc_ensure_root (); chsrc_ensure_root ();
chsrc_yield_source_and_confirm (os_anolis); use_this(os_anolis);
Source_t source = chsrc_yield_source_and_confirm (this, option);
char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo"); char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
chsrc_run (cmd, RunOpt_Default); chsrc_run (cmd, RunOpt_Default);
@ -35,6 +56,3 @@ os_anolis_setsrc (char *option)
chsrc_determine_chgtype (ChgType_Untested); chsrc_determine_chgtype (ChgType_Untested);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
def_target(os_anolis);

View File

@ -1,29 +1,51 @@
chef_set_created_on ("2023-09-26"); /** ------------------------------------------------------------
chef_set_authors ("Heng Guo <2085471348@qq.com>", "happy game <happygame1024@gmail.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("Aoran Zeng <ccmywish@qq.com>"); * ------------------------------------------------------------*/
chef_allow_set();
chef_allow_reset();
use_this;
/** def_target(os_fedora);
* @update 2025-06-20
*/ void
static Source_t os_fedora_sources[] = os_fedora_prelude ()
{ {
{&UpstreamProvider, "http://download.example/pub/fedora/linux", DelegateToUpstream}, use_this(os_fedora);
{&Ali, "https://mirrors.aliyun.com/fedora", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/fedora", DelegateToMirror}, chef_set_created_on (this, "2023-09-26");
{&Ustc, "https://mirrors.ustc.edu.cn/fedora", DelegateToMirror}, chef_set_last_updated (this, "2025-08-10");
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/fedora", DelegateToMirror}, chef_set_sources_last_updated (this, "2025-06-20");
{&Tencent, "https://mirrors.tencent.com/fedora", DelegateToMirror},
chef_set_authors (this, 2,
"Heng Guo", "2085471348@qq.com",
"happy game", "happygame1024@gmail.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 1,
"Aoran Zeng", "ccmywish@qq.com");
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://download.example/pub/fedora/linux");
def_sources_begin()
{&upstream, "http://download.example/pub/fedora/linux", DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/fedora", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/fedora", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/fedora", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/fedora", DelegateToMirror},
{&Tencent, "https://mirrors.tencent.com/fedora", DelegateToMirror}
// {&Tencent_Intra, "https://mirrors.tencentyun.com/fedora", DelegateToMirror}, // {&Tencent_Intra, "https://mirrors.tencentyun.com/fedora", DelegateToMirror},
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Netease, "https://mirrors.163.com/fedora", DelegateToMirror}, // {&Netease, "https://mirrors.163.com/fedora", DelegateToMirror},
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Sohu, "https://mirrors.sohu.com/fedora", DelegateToMirror}" // {&Sohu, "https://mirrors.sohu.com/fedora", DelegateToMirror}"
}; def_sources_end()
def_sources_n(os_fedora); }
/** /**
@ -36,7 +58,8 @@ os_fedora_setsrc (char *option)
{ {
chsrc_ensure_root (); chsrc_ensure_root ();
chsrc_yield_source_and_confirm (os_fedora); use_this(os_fedora);
Source_t source = chsrc_yield_source_and_confirm (this, option);
chsrc_alert2 ("Fedora 38 及以下版本暂不支持"); chsrc_alert2 ("Fedora 38 及以下版本暂不支持");
@ -79,6 +102,3 @@ os_fedora_resetsrc (char *option)
{ {
os_fedora_setsrc (option); os_fedora_setsrc (option);
} }
def_target(os_fedora);

View File

@ -1,30 +1,47 @@
chef_set_created_on ("2023-09-24"); /** ------------------------------------------------------------
chef_set_authors ("Aoran Zeng <ccmywish@qq.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("happy game <happygame1024@gmail.com>"); * ------------------------------------------------------------*/
chef_allow_set();
chef_allow_reset();
use_this;
/** def_target(os_rockylinux);
* @update 2025-06-20
*/ void
static Source_t os_rockylinux_sources[] = os_rockylinux_prelude ()
{ {
{&UpstreamProvider, NULL, NULL}, use_this(os_rockylinux);
{&MirrorZ, "https://mirrors.cernet.edu.cn/rocky", DelegateToMirror},
{&Ali, "https://mirrors.aliyun.com/rockylinux", DelegateToMirror},
{&Volcengine, "https://mirrors.volces.com/rockylinux", DelegateToMirror},
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rocky", DelegateToMirror},
{&Sustech, "https://mirrors.sustech.edu.cn/rocky-linux", DelegateToMirror},
{&Zju, "https://mirrors.zju.edu.cn/rocky", DelegateToMirror},
{&Lzuoss, "https://mirror.lzu.edu.cn/rocky", DelegateToMirror},
chef_set_created_on (this, "2023-09-24");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
chef_set_chef (this, NULL, NULL);
chef_set_sous_chefs (this, 0);
chef_set_contributors (this, 1,
"happy game", "happygame1024@gmail.com");
chef_allow_set();
chef_allow_reset();
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
def_upstream ("https://dl.rockylinux.org/");
def_sources_begin()
{&upstream, "https://dl.rockylinux.org", DelegateToUpstream},
{&MirrorZ, "https://mirrors.cernet.edu.cn/rocky", DelegateToMirror},
{&Ali, "https://mirrors.aliyun.com/rockylinux", DelegateToMirror},
{&Volcengine, "https://mirrors.volces.com/rockylinux", DelegateToMirror},
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/rocky", DelegateToMirror},
{&Sustech, "https://mirrors.sustech.edu.cn/rocky-linux", DelegateToMirror},
{&Zju, "https://mirrors.zju.edu.cn/rocky", DelegateToMirror},
{&Lzuoss, "https://mirror.lzu.edu.cn/rocky", DelegateToMirror},
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Netease, "https://mirrors.163.com/rocky", DelegateToMirror}, // {&Netease, "https://mirrors.163.com/rocky", DelegateToMirror},
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Sohu, "https://mirrors.sohu.com/Rocky", DelegateToMirror} // {&Sohu, "https://mirrors.sohu.com/Rocky", DelegateToMirror}
}; def_sources_end()
def_sources_n(os_rockylinux); }
/** /**
@ -67,9 +84,12 @@ os_rockylinux_setsrc (char *option)
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_determine_chgtype (ChgType_Auto);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
def_target(os_rockylinux); void
os_rockylinux_resetsrc (char *option)
{
os_rockylinux_setsrc (option);
}

View File

@ -1,35 +1,53 @@
chef_set_created_on ("2023-09-06"); /** ------------------------------------------------------------
chef_set_authors ("Heng Guo <2085471348@qq.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("Aoran Zeng <ccmywish@qq.com>", "Yangmoooo <yangmoooo@outlook.com>", "happy game <happygame1024@gmail.com>"); * ------------------------------------------------------------*/
chef_allow_set();
use_this;
static SourceProvider_t os_openEuler_upstream = def_target(os_openeuler);
void
os_openeuler_prelude ()
{ {
def_upstream, "https://repo.openeuler.org/", use_this(os_openeuler);
{NotSkip, NA, NA, "https://repo.openeuler.org/openEuler-24.03-LTS/ISO/x86_64/openEuler-24.03-LTS-netinst-x86_64-dvd.iso", ACCURATE} // 896MB
};
chef_set_created_on (this, "2023-09-06");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
/** chef_set_authors (this, 1, "Heng Guo", "2085471348@qq.com");
* @update 2025-06-20 chef_set_chef (this, NULL, NULL);
*/ chef_set_sous_chefs (this, 0);
static Source_t os_openeuler_sources[] = chef_set_contributors (this, 3,
{ "Aoran Zeng", "ccmywish@qq.com",
{&os_openEuler_upstream, "https://repo.openeuler.org/", DelegateToUpstream}, "Yangmoooo", "yangmoooo@outlook.com",
{&Ali, "https://mirrors.aliyun.com/openeuler/", DelegateToMirror}, "happy game", "happygame1024@gmail.com");
{&Bfsu, "https://mirrors.bfsu.edu.cn/openeuler/", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/openeuler/", DelegateToMirror}, chef_allow_get();
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/openeuler/", DelegateToMirror}, chef_allow_set();
{&Tencent, "https://mirrors.tencent.com/openeuler/", DelegateToMirror},
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://repo.openeuler.org/");
def_sources_begin()
{&upstream, "https://repo.openeuler.org/", DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/openeuler/", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/openeuler/", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/openeuler/", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/openeuler/", DelegateToMirror},
{&Tencent, "https://mirrors.tencent.com/openeuler/", DelegateToMirror}
// {&Tencent_Intra, "https://mirrors.tencentyun.com/openeuler/", DelegateToMirror}, // {&Tencent_Intra, "https://mirrors.tencentyun.com/openeuler/", DelegateToMirror},
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Netease, "https://mirrors.163.com/openeuler/", DelegateToMirror} // {&Netease, "https://mirrors.163.com/openeuler/", DelegateToMirror}
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Sohu, "https://mirrors.sohu.com/openeuler/", DelegateToMirror} // {&Sohu, "https://mirrors.sohu.com/openeuler/", DelegateToMirror}
}; def_sources_end()
def_sources_n(os_openeuler);
chsrc_set_provider_speed_measure_url (&upstream, "https://repo.openeuler.org/openEuler-24.03-LTS/ISO/x86_64/openEuler-24.03-LTS-netinst-x86_64-dvd.iso");
}
/** /**
@ -50,7 +68,8 @@ os_openeuler_setsrc (char *option)
{ {
chsrc_ensure_root (); chsrc_ensure_root ();
chsrc_yield_source_and_confirm (os_openeuler); use_this(os_openeuler);
Source_t source = chsrc_yield_source_and_confirm (this, option);
chsrc_backup (OS_openEuler_SourceList); chsrc_backup (OS_openEuler_SourceList);