From 7d16a0eb6520cbcd073a2e1ecf90414435722978 Mon Sep 17 00:00:00 2001 From: happygame Date: Wed, 9 Oct 2024 13:48:43 +0800 Subject: [PATCH 1/2] Fix Fedora MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 不再支持fedora 38及以下 - 默认使用metalink匹配最快源, 提示用户可自行注释 --- src/recipe/os/YUM/Fedora-Linux.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/recipe/os/YUM/Fedora-Linux.c b/src/recipe/os/YUM/Fedora-Linux.c index 7d2fb140..155a3709 100644 --- a/src/recipe/os/YUM/Fedora-Linux.c +++ b/src/recipe/os/YUM/Fedora-Linux.c @@ -4,13 +4,13 @@ * File Authors : Heng Guo <2085471348@qq.com> * Contributors : Aoran Zeng * Created On : <2023-09-26> - * Last Modified : <2024-09-14> + * Last Modified : <2024-10-09> * * 名称为 Fedora Linux * ------------------------------------------------------------*/ /** - * @update 2024-09-14 + * @update 2024-10-09 */ static SourceInfo os_fedora_sources[] = { @@ -28,7 +28,9 @@ def_sources_n(os_fedora); /** - * @note fedora 29 及以下版本暂不支持 + * @note fedora 38 及以下版本暂不支持 + * 参考: + * 1. https://mirrors.ustc.edu.cn/help/fedora.html */ void os_fedora_setsrc (char *option) @@ -37,27 +39,25 @@ os_fedora_setsrc (char *option) chsrc_yield_source_and_confirm (os_fedora); - chsrc_note2 ("Fedora 29 及以下版本暂不支持"); + chsrc_note2 ("Fedora 38 及以下版本暂不支持"); chsrc_backup ("/etc/yum.repos.d/fedora.repo"); chsrc_backup ("/etc/yum.repos.d/fedora-updates.repo"); - char* cmd = xy_strjoin (9, "sed -e 's|^metalink=|#metalink=|g' ", + char* cmd = xy_strjoin (7, "sed ", "-e 's|^#baseurl=http://download.example/pub/fedora/linux/|baseurl=", source.url, "|g' ", "-i.bak ", "/etc/yum.repos.d/fedora.repo ", - "/etc/yum.repos.d/fedora-modular.repo ", - "/etc/yum.repos.d/fedora-updates.repo ", - "/etc/yum.repos.d/fedora-updates-modular.repo"); + "/etc/yum.repos.d/fedora-updates.repo"); chsrc_run (cmd, RunOpt_Default); chsrc_log2 ("已替换文件 /etc/yum.repos.d/fedora.repo"); - chsrc_log2 ("已新增文件 /etc/yum.repos.d/fedora-modular.repo"); chsrc_log2 ("已替换文件 /etc/yum.repos.d/fedora-updates.repo"); - chsrc_log2 ("已新增文件 /etc/yum.repos.d/fedora-updates-modular.repo"); + + chsrc_note2 ("chsrc 已为您更换baseurl, 但fedora默认会优先使用metalink来匹配最快的源, 如您在获取metadata时速度较慢可自行将其注释"); chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line); chsrc_conclude (&source, SetsrcType_Auto); From 0cf5f1c5206a15ae82a3bf9b60afd4a6fdc5e1af Mon Sep 17 00:00:00 2001 From: happygame Date: Wed, 9 Oct 2024 14:49:25 +0800 Subject: [PATCH 2/2] add-contributor-info --- src/chsrc-main.c | 1 + src/recipe/os/YUM/Fedora-Linux.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chsrc-main.c b/src/chsrc-main.c index 97f0be87..9e5dead2 100644 --- a/src/chsrc-main.c +++ b/src/chsrc-main.c @@ -12,6 +12,7 @@ * | Mr. Will * | Terrasse * | Lontten + * | happy game * | * Created On : <2023-08-28> * Last Modified : <2024-10-04> diff --git a/src/recipe/os/YUM/Fedora-Linux.c b/src/recipe/os/YUM/Fedora-Linux.c index 155a3709..303bb115 100644 --- a/src/recipe/os/YUM/Fedora-Linux.c +++ b/src/recipe/os/YUM/Fedora-Linux.c @@ -4,7 +4,7 @@ * File Authors : Heng Guo <2085471348@qq.com> * Contributors : Aoran Zeng * Created On : <2023-09-26> - * Last Modified : <2024-10-09> + * Last Modified : <2024-10-09> * * 名称为 Fedora Linux * ------------------------------------------------------------*/