Update BSD and pacman recipes using chef DSL

This commit is contained in:
Aoran Zeng 2025-08-10 13:29:11 +08:00
parent 4d10023993
commit a936136d14
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
6 changed files with 253 additions and 128 deletions

View File

@ -1,24 +1,41 @@
chef_set_created_on ("2023-09-03"); /** ------------------------------------------------------------
chef_set_authors ("Aoran Zeng <ccmywish@qq.com>", "Heng Guo <2085471348@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_freebsd);
* @update 2023-09-27
* void
* @note os_freebsd_prelude ()
* 2023-09-24: USTC, NJU, Netease freebsd-pkg freebsd-ports
* 2023-09-27: Nju前面有至少一个镜像 freebsd
*/
static Source_t os_freebsd_sources[] =
{ {
{&UpstreamProvider, NULL, NULL}, use_this(os_freebsd);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2023-09-27");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com", "Heng Guo", "2085471348@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 ("2023-09-24: 以下三个USTC, NJU, Netease 均维护了 freebsd-pkg freebsd-ports\n2023-09-27: 请务必保持Nju前面有至少一个镜像原因请查看 freebsd 的换源函数", NULL);
def_upstream (NULL);
def_sources_begin()
{&upstream, NULL, DelegateToUpstream},
{&Ustc, "mirrors.ustc.edu.cn", DelegateToMirror}, {&Ustc, "mirrors.ustc.edu.cn", DelegateToMirror},
{&Nju, "mirror.nju.edu.cn", DelegateToMirror}, {&Nju, "mirror.nju.edu.cn", DelegateToMirror},
{&Netease, "mirrors.163.com", DelegateToMirror}, {&Netease, "mirrors.163.com", DelegateToMirror},
}; def_sources_end()
def_sources_n(os_freebsd); }
/** /**
* @consult * @consult
@ -123,9 +140,5 @@ os_freebsd_setsrc (char *option)
chsrc_overwrite_file (update, "/etc/freebsd-update.conf"); chsrc_overwrite_file (update, "/etc/freebsd-update.conf");
*/ */
chsrc_determine_chgtype (ChgType_SemiAuto);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
def_target(os_freebsd);

View File

@ -1,16 +1,37 @@
chef_set_created_on ("2023-09-05"); /** ------------------------------------------------------------
chef_set_authors ("Aoran Zeng <ccmywish@qq.com>", "Heng Guo <2085471348@qq.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("Nil Null <nil@null.org>"); * ------------------------------------------------------------*/
def_target(os_netbsd);
void
os_netbsd_prelude ()
{
use_this(os_netbsd);
chef_set_created_on (this, "2023-09-05");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-31");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com", "Heng Guo", "2085471348@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_get(); chef_allow_get();
chef_allow_set(); chef_allow_set();
use_this;
/** chef_allow_local_mode (this, CanNot, NULL, NULL);
* @update 2025-07-31 chef_forbid_english(this);
*/ chef_forbid_user_define(this);
static Source_t os_netbsd_sources[] =
{ chef_set_note ("根据 @ykla: NetBSD 默认状态下没有 pkgsrc用户可能安装了也可能没安装", NULL);
{&UpstreamProvider, NULL, NULL},
def_upstream (NULL);
def_sources_begin()
{&upstream, NULL, DelegateToUpstream},
{&MirrorZ, "https://mirrors.cernet.edu.cn/pkgsrc/packages/NetBSD/", DelegateToMirror}, {&MirrorZ, "https://mirrors.cernet.edu.cn/pkgsrc/packages/NetBSD/", DelegateToMirror},
{&Ali, "https://mirrors.aliyun.com/pkgsrc/packages/NetBSD/", DelegateToMirror}, {&Ali, "https://mirrors.aliyun.com/pkgsrc/packages/NetBSD/", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/pkgsrc/packages/NetBSD/", DelegateToMirror}, {&Ustc, "https://mirrors.ustc.edu.cn/pkgsrc/packages/NetBSD/", DelegateToMirror},
@ -21,8 +42,8 @@ static Source_t os_netbsd_sources[] =
// {&Tencent_Intra, "https://mirrors.tencentyun.com/pkgsrc/packages/NetBSD/", DelegateToMirror}, // {&Tencent_Intra, "https://mirrors.tencentyun.com/pkgsrc/packages/NetBSD/", DelegateToMirror},
{&Netease, "https://mirrors.163.com/pkgsrc/packages/NetBSD/", DelegateToMirror}, {&Netease, "https://mirrors.163.com/pkgsrc/packages/NetBSD/", DelegateToMirror},
{&Sohu, "https://mirrors.sohu.com/pkgsrc/packages/NetBSD/", DelegateToMirror} {&Sohu, "https://mirrors.sohu.com/pkgsrc/packages/NetBSD/", DelegateToMirror}
}; def_sources_end()
def_sources_n(os_netbsd); }
void void
@ -56,9 +77,5 @@ os_netbsd_setsrc (char *option)
char *url = xy_strjoin (5, chef_ensure_trailing_slash (source.url), arch, "/", version, "/All"); char *url = xy_strjoin (5, chef_ensure_trailing_slash (source.url), arch, "/", version, "/All");
chsrc_overwrite_file (url, "/usr/pkg/etc/pkgin/repositories.conf"); chsrc_overwrite_file (url, "/usr/pkg/etc/pkgin/repositories.conf");
chsrc_determine_chgtype (ChgType_Untested);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
def_target(os_netbsd);

View File

@ -1,16 +1,35 @@
chef_set_created_on ("2023-09-03"); /** ------------------------------------------------------------
chef_set_authors ("Heng Guo <2085471348@qq.com>", "Aoran Zeng <ccmywish@qq.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("Nil Null <nil@null.org>"); * ------------------------------------------------------------*/
def_target(os_openbsd);
void
os_openbsd_prelude ()
{
use_this(os_openbsd);
chef_set_created_on (this, "2023-09-03");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-07-31");
chef_set_authors (this, 2, "Heng Guo", "2085471348@qq.com", "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_get(); chef_allow_get();
chef_allow_set(); chef_allow_set();
use_this;
/** chef_allow_local_mode (this, CanNot, NULL, NULL);
* @update 2025-07-31 chef_forbid_english(this);
*/ chef_forbid_user_define(this);
static Source_t os_openbsd_sources[] =
{ def_upstream (NULL);
{&UpstreamProvider, NULL, NULL},
def_sources_begin()
{&upstream, NULL, DelegateToUpstream},
{&MirrorZ, "https://mirrors.cernet.edu.cn/OpenBSD/", DelegateToMirror}, {&MirrorZ, "https://mirrors.cernet.edu.cn/OpenBSD/", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/OpenBSD/", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn/OpenBSD/", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/OpenBSD/", DelegateToMirror}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/OpenBSD/", DelegateToMirror},
@ -24,8 +43,8 @@ static Source_t os_openbsd_sources[] =
// {&Tencent_Intra, "https://mirrors.tencentyun.com/OpenBSD/", DelegateToMirror}, // {&Tencent_Intra, "https://mirrors.tencentyun.com/OpenBSD/", DelegateToMirror},
{&Netease, "https://mirrors.163.com/OpenBSD/", DelegateToMirror}, {&Netease, "https://mirrors.163.com/OpenBSD/", DelegateToMirror},
{&Sohu, "https://mirrors.sohu.com/OpenBSD/", DelegateToMirror} {&Sohu, "https://mirrors.sohu.com/OpenBSD/", DelegateToMirror}
}; def_sources_end()
def_sources_n(os_openbsd); }
void void
@ -50,9 +69,5 @@ os_openbsd_setsrc (char *option)
chsrc_backup ("/etc/installurl"); chsrc_backup ("/etc/installurl");
chsrc_overwrite_file (source.url, "/etc/installurl"); chsrc_overwrite_file (source.url, "/etc/installurl");
chsrc_determine_chgtype (ChgType_Auto);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
def_target(os_openbsd);

View File

@ -1,18 +1,42 @@
chef_set_created_on ("2023-09-05"); /** ------------------------------------------------------------
chef_set_authors ("Aoran Zeng <ccmywish@qq.com>", "Heng Guo <2085471348@qq.com>"); * SPDX-License-Identifier: GPL-3.0-or-later
chef_set_contributors ("happy game <happygame1024@gmail.com>"); * ------------------------------------------------------------*/
def_target(os_arch);
#define OS_Pacman_MirrorList "/etc/pacman.d/mirrorlist"
#define OS_Pacman_ArchLinuxCN_MirrorList "/etc/pacman.conf"
void
os_arch_prelude ()
{
use_this(os_arch);
chef_set_created_on (this, "2023-09-05");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2025-06-20");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com",
"Heng Guo", "2085471348@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_get(); chef_allow_get();
chef_allow_set(); chef_allow_set();
chef_note("可额外使用 chsrc set archlinuxcn 来更换 Arch Linux CN Repository 源");
use_this;
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_set_note ("可额外使用 chsrc set archlinuxcn 来更换 Arch Linux CN Repository 源", "You can additionally use chsrc set archlinuxcn to change Arch Linux CN Repository source");
def_upstream (NULL);
/** /**
* @update 2025-06-20
* @note / ARM情况下 arm * @note / ARM情况下 arm
*/ */
static Source_t os_arch_sources[] = def_sources_begin()
{
{&UpstreamProvider, NULL, NULL},
{&Ali, "https://mirrors.aliyun.com/archlinux", DelegateToMirror}, {&Ali, "https://mirrors.aliyun.com/archlinux", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/archlinux", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn/archlinux", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/archlinux", DelegateToMirror}, {&Ustc, "https://mirrors.ustc.edu.cn/archlinux", DelegateToMirror},
@ -25,37 +49,17 @@ static Source_t os_arch_sources[] =
// {&Netease, "https://mirrors.163.com/archlinux", DelegateToMirror}, // {&Netease, "https://mirrors.163.com/archlinux", DelegateToMirror},
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Sohu, "https://mirrors.sohu.com/archlinux", DelegateToMirror} // {&Sohu, "https://mirrors.sohu.com/archlinux", DelegateToMirror}
}, def_sources_end()
}
/**
* @update 2024-07-03
* @note @zheng7fu2 archlinuxcn
*/
os_archlinuxcn_sources[] =
{
{&UpstreamProvider, "https://repo.archlinuxcn.org/", DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/archlinuxcn/", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/archlinuxcn/", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/archlinuxcn/", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/", DelegateToMirror},
{&Tencent, "https://mirrors.cloud.tencent.com/archlinuxcn/", DelegateToMirror},
// {&Tencent_Intra, "https://mirrors.cloud.tencentyun.com/archlinuxcn/", DelegateToMirror},
/* 不启用原因:过慢 */
// {&Netease, "https://mirrors.163.com/archlinux-cn/", DelegateToMirror}
};
def_sources_n(os_arch);
def_sources_n(os_archlinuxcn);
#define OS_Pacman_MirrorList "/etc/pacman.d/mirrorlist"
#define OS_Pacman_ArchLinuxCN_MirrorList "/etc/pacman.conf"
void void
os_arch_getsrc (char *option) os_arch_getsrc (char *option)
{ {
chsrc_view_file (OS_Pacman_MirrorList); chsrc_view_file (OS_Pacman_MirrorList);
} }
/** /**
* @consult * @consult
* 1. https://mirrors.tuna.tsinghua.edu.cn/help/archlinux/ * 1. https://mirrors.tuna.tsinghua.edu.cn/help/archlinux/
@ -102,6 +106,56 @@ os_arch_setsrc (char *option)
} }
/** ------------------------------------------------------------
* archlinuxcn target
* ------------------------------------------------------------*/
def_target(os_archlinuxcn);
void
os_archlinuxcn_prelude ()
{
use_this(os_archlinuxcn);
chef_set_created_on (this, "2023-09-05");
chef_set_last_updated (this, "2025-08-10");
chef_set_sources_last_updated (this, "2024-07-03");
chef_set_authors (this, 2, "Aoran Zeng", "ccmywish@qq.com", "Heng Guo", "2085471348@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_get();
chef_allow_set();
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
chef_set_note ("可额外使用 chsrc set arch 来更换 Arch Linux 源", "You can additionally use chsrc set arch to change Arch Linux source");
def_upstream ("https://repo.archlinuxcn.org/");
/**
* @note @zheng7fu2 archlinuxcn
*/
def_sources_begin()
{&upstream, NULL, DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/archlinuxcn/", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/archlinuxcn/", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/archlinuxcn/", DelegateToMirror},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/", DelegateToMirror},
{&Tencent, "https://mirrors.cloud.tencent.com/archlinuxcn/", DelegateToMirror},
// {&Tencent_Intra, "https://mirrors.cloud.tencentyun.com/archlinuxcn/", DelegateToMirror},
/* 不启用原因:过慢 */
// {&Netease, "https://mirrors.163.com/archlinux-cn/", DelegateToMirror}
def_sources_end()
}
void void
os_archlinuxcn_getsrc (char *option) os_archlinuxcn_getsrc (char *option)
{ {
@ -147,17 +201,3 @@ os_archlinuxcn_setsrc (char *option)
chsrc_determine_chgtype (ChgType_Auto); chsrc_determine_chgtype (ChgType_Auto);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
#undef OS_Pacman_MirrorList
#undef OS_Pacman_ArchLinuxCN_MirrorList
def_target_has_note("可额外使用 chsrc set arch 来更换 Arch Linux 源");
def_target(os_arch);
chef_set_created_on ("2023-09-05");
chef_set_authors ("Aoran Zeng <ccmywish@qq.com>", "Heng Guo <2085471348@qq.com>");
chef_set_contributors ("happy game <happygame1024@gmail.com>");
chef_allow_get();
chef_allow_set();
chef_note("可额外使用 chsrc set arch 来更换 Arch Linux 源");
def_target(os_archlinuxcn);

View File

@ -1,15 +1,34 @@
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>"); * ------------------------------------------------------------*/
chef_allow_set();
use_this;
/** def_target(os_msys2);
* @update 2025-06-20
*/ void
static Source_t os_msys2_sources[] = os_msys2_prelude ()
{ {
{&UpstreamProvider, NULL, NULL}, use_this(os_msys2);
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");
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_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
def_upstream (NULL);
def_sources_begin()
{&upstream, NULL, DelegateToUpstream},
{&Ali, "https://mirrors.aliyun.com/msys2", DelegateToMirror}, {&Ali, "https://mirrors.aliyun.com/msys2", DelegateToMirror},
{&Bfsu, "https://mirrors.bfsu.edu.cn/msys2", DelegateToMirror}, {&Bfsu, "https://mirrors.bfsu.edu.cn/msys2", DelegateToMirror},
{&Ustc, "https://mirrors.ustc.edu.cn/msys2", DelegateToMirror}, {&Ustc, "https://mirrors.ustc.edu.cn/msys2", DelegateToMirror},
@ -20,8 +39,8 @@ static Source_t os_msys2_sources[] =
// {&Netease, "https://mirrors.163.com/msys2", DelegateToMirror}, // {&Netease, "https://mirrors.163.com/msys2", DelegateToMirror},
/* 不启用原因:过慢 */ /* 不启用原因:过慢 */
// {&Sohu, "https://mirrors.sohu.com/msys2", DelegateToMirror} // {&Sohu, "https://mirrors.sohu.com/msys2", DelegateToMirror}
}; def_sources_end()
def_sources_n(os_msys2); }
/** /**
@ -47,9 +66,5 @@ os_msys2_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default); chsrc_run (cmd, RunOpt_Default);
chsrc_determine_chgtype (ChgType_Untested);
chsrc_conclude (&source); chsrc_conclude (&source);
} }
def_target(os_msys2);

View File

@ -1,8 +1,36 @@
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 ("Nil Null <nil@null.org>"); * ------------------------------------------------------------*/
def_target(os_manjaro);
void
os_manjaro_prelude ()
{
use_this(os_manjaro);
chef_set_created_on (this, "2023-09-06");
chef_set_last_updated (this, "2025-08-10");
chef_set_authors (this, 1, "Heng Guo", "2085471348@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_set();
use_this;
chef_allow_local_mode (this, CanNot, NULL, NULL);
chef_forbid_english(this);
chef_forbid_user_define(this);
def_upstream (NULL);
def_sources_begin()
{&upstream, NULL, DelegateToUpstream}
/* Manjaro uses GUI tool, no manual sources needed */
def_sources_end()
}
/** /**
* GUI * GUI
@ -16,8 +44,5 @@ os_manjaro_setsrc (char *option)
chsrc_run ("pacman -Syy", RunOpt_No_Last_New_Line); chsrc_run ("pacman -Syy", RunOpt_No_Last_New_Line);
chsrc_determine_chgtype (ChgType_Auto);
chsrc_conclude (NULL); chsrc_conclude (NULL);
} }
def_target(os_manjaro);