Skip to content

Commit 3146c7f

Browse files
happy-gameccmywish
authored andcommitted
Fix Fedora
- 不再支持fedora 38及以下 - 默认使用metalink匹配最快源, 提示用户可自行注释
1 parent 5382093 commit 3146c7f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/recipe/os/YUM/Fedora-Linux.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
* File Authors : Heng Guo <[email protected]>
55
* Contributors : Aoran Zeng <[email protected]>
66
* Created On : <2023-09-26>
7-
* Last Modified : <2024-09-14>
7+
* Last Modified : <2024-10-09>
88
*
99
* 名称为 Fedora Linux
1010
* ------------------------------------------------------------*/
1111

1212
/**
13-
* @update 2024-09-14
13+
* @update 2024-10-09
1414
*/
1515
static SourceInfo
1616
os_fedora_sources[] = {
@@ -28,7 +28,9 @@ def_sources_n(os_fedora);
2828

2929

3030
/**
31-
* @note fedora 29 及以下版本暂不支持
31+
* @note fedora 38 及以下版本暂不支持
32+
* 参考:
33+
* 1. https://mirrors.ustc.edu.cn/help/fedora.html
3234
*/
3335
void
3436
os_fedora_setsrc (char *option)
@@ -37,27 +39,25 @@ os_fedora_setsrc (char *option)
3739

3840
chsrc_yield_source_and_confirm (os_fedora);
3941

40-
chsrc_note2 ("Fedora 29 及以下版本暂不支持");
42+
chsrc_note2 ("Fedora 38 及以下版本暂不支持");
4143

4244
chsrc_backup ("/etc/yum.repos.d/fedora.repo");
4345
chsrc_backup ("/etc/yum.repos.d/fedora-updates.repo");
4446

45-
char* cmd = xy_strjoin (9, "sed -e 's|^metalink=|#metalink=|g' ",
47+
char* cmd = xy_strjoin (7, "sed ",
4648
"-e 's|^#baseurl=http://download.example/pub/fedora/linux/|baseurl=",
4749
source.url,
4850
"|g' ",
4951
"-i.bak ",
5052
"/etc/yum.repos.d/fedora.repo ",
51-
"/etc/yum.repos.d/fedora-modular.repo ",
52-
"/etc/yum.repos.d/fedora-updates.repo ",
53-
"/etc/yum.repos.d/fedora-updates-modular.repo");
53+
"/etc/yum.repos.d/fedora-updates.repo");
5454

5555
chsrc_run (cmd, RunOpt_Default);
5656

5757
chsrc_log2 ("已替换文件 /etc/yum.repos.d/fedora.repo");
58-
chsrc_log2 ("已新增文件 /etc/yum.repos.d/fedora-modular.repo");
5958
chsrc_log2 ("已替换文件 /etc/yum.repos.d/fedora-updates.repo");
60-
chsrc_log2 ("已新增文件 /etc/yum.repos.d/fedora-updates-modular.repo");
59+
60+
chsrc_note2 ("chsrc 已为您更换baseurl, 但fedora默认会优先使用metalink来匹配最快的源, 如您在获取metadata时速度较慢可自行将其注释");
6161

6262
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
6363
chsrc_conclude (&source, SetsrcType_Auto);

0 commit comments

Comments
 (0)