@@ -7,16 +7,19 @@ def_dish(os_arch, "arch/archlinux");
77#define OS_Pacman_MirrorList "/etc/pacman.d/mirrorlist"
88#define OS_Pacman_ArchLinuxCN_MirrorList "/etc/pacman.conf"
99
10+ /* Arch 官方源(geo 自动选最近镜像),换源后作兜底 */
11+ #define OS_Arch_Upstream "https://geo.mirror.pkgbuild.com"
12+
1013void
1114os_arch_prepare ()
1215{
13- chef_prep_this_dish (os_arch , gs );
16+ chef_prep_this_dish (os_arch , gsr );
1417
1518 chef_set_recipe_created_on (this , "2023-09-05" );
16- chef_set_recipe_last_updated (this , "2025-10-30 " );
19+ chef_set_recipe_last_updated (this , "2026-09-06 " );
1720
1821 chef_set_chefs (this , 2 , "@ccmywish" , "@G_I_Y" );
19- chef_set_sauciers (this , 2 , "@happy-game" , "@Young-Lord" );
22+ chef_set_sauciers (this , 3 , "@happy-game" , "@Young-Lord" , "@yayoinoyume " );
2023
2124 chef_set_os_scope (this );
2225 chef_deny_english (this );
@@ -30,7 +33,7 @@ os_arch_prepare ()
3033 * @note 不要给后面加 / ,因为ARM情况下,还要额外加一个 arm 后缀
3134 */
3235 def_sources_begin ()
33- {& UpstreamProvider , "https://repo.archlinux.org" , DelegateToUpstream },
36+ {& UpstreamProvider , "https://geo.mirror.pkgbuild.com" , DelegateToUpstream },
3437 {& Ali , "https://mirrors.aliyun.com/archlinux" , DelegateToMirror },
3538 {& Bfsu , "https://mirrors.bfsu.edu.cn/archlinux" , DelegateToMirror },
3639 {& Ustc , "https://mirrors.ustc.edu.cn/archlinux" , DelegateToMirror },
@@ -77,6 +80,12 @@ os_arch_setsrc (char *option)
7780 {
7881 is_x86 = true;
7982 to_write = xy_strcat (3 , "Server = " , source .url , "/$repo/os/$arch\n" );
83+ /* 新源后补官方兜底(目标即官方时不重复) */
84+ if (!xy_streql (source .url , OS_Arch_Upstream ))
85+ to_write = xy_strcat (2 , to_write , "Server = " OS_Arch_Upstream "/$repo/os/$arch\n" );
86+
87+ /* 换源前先清掉已累积的 Server 行再写入,保证幂等(仅 x86) */
88+ chsrc_run ("sed -i '/^Server = /d' " OS_Pacman_MirrorList , RunOpt_Default );
8089 }
8190 else
8291 {
@@ -101,6 +110,13 @@ os_arch_setsrc (char *option)
101110}
102111
103112
113+ /* reset = 恢复官方源,走同一 setsrc(框架会令 source 落到官方源) */
114+ void
115+ os_arch_resetsrc (char * option )
116+ {
117+ os_arch_setsrc (option );
118+ }
119+
104120
105121/** ------------------------------------------------------------
106122 * archlinuxcn dish
0 commit comments