From cfb0c61a340987e6cbb06b75ac48ba56095f1a94 Mon Sep 17 00:00:00 2001 From: happy-game Date: Mon, 4 Nov 2024 09:06:12 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dfedora=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=86=8D=E6=AC=A1=E6=8D=A2=E6=BA=90=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recipe/os/YUM/Fedora-Linux.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/recipe/os/YUM/Fedora-Linux.c b/src/recipe/os/YUM/Fedora-Linux.c index ab021ef1..f03597df 100644 --- a/src/recipe/os/YUM/Fedora-Linux.c +++ b/src/recipe/os/YUM/Fedora-Linux.c @@ -5,7 +5,7 @@ * Contributors : Aoran Zeng * | happy game * Created On : <2023-09-26> - * Last Modified : <2024-10-09> + * Last Modified : <2024-11-04> * * 名称为 Fedora Linux * ------------------------------------------------------------*/ @@ -45,14 +45,23 @@ os_fedora_setsrc (char *option) chsrc_backup ("/etc/yum.repos.d/fedora.repo"); chsrc_backup ("/etc/yum.repos.d/fedora-updates.repo"); - char* cmd = xy_strjoin (7, "sed ", - "-e 's|^#baseurl=http://download.example/pub/fedora/linux/|baseurl=", - source.url, + // 取消注释 baseurl + char* cmd = xy_strjoin (5, "sed ", + "-i 's|^#baseurl=|baseurl=", "|g' ", - "-i.bak ", "/etc/yum.repos.d/fedora.repo ", "/etc/yum.repos.d/fedora-updates.repo"); + chsrc_run (cmd, RunOpt_Default); + // fedora的换源涉及 /etc/yum.repos.d/fedora.repo和 /etc/yum.repos.d/fedora-updates.repo + // 需要替换 baseurl=source.url/releases/... 和 baseurl=source.url/releases/... + cmd = xy_strjoin (7, "sed ", + "-i -E 's!^baseurl=.*?/(releases|updates)/!baseurl=", + source.url, + "/\\1/", + "!g' ", + "/etc/yum.repos.d/fedora.repo ", + "/etc/yum.repos.d/fedora-updates.repo"); chsrc_run (cmd, RunOpt_Default); chsrc_note2 ("已为您更换baseurl, 但fedora默认会优先使用metalink来匹配最快的源, 如您在获取metadata时速度较慢可自行将其注释:"); From 28a72c1009a665cdb83c20f9d49558404a557e70 Mon Sep 17 00:00:00 2001 From: happy-game Date: Mon, 4 Nov 2024 09:09:42 +0000 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0fedora=E7=9A=84Up?= =?UTF-8?q?stream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recipe/os/YUM/Fedora-Linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/recipe/os/YUM/Fedora-Linux.c b/src/recipe/os/YUM/Fedora-Linux.c index f03597df..19262298 100644 --- a/src/recipe/os/YUM/Fedora-Linux.c +++ b/src/recipe/os/YUM/Fedora-Linux.c @@ -11,11 +11,11 @@ * ------------------------------------------------------------*/ /** - * @update 2024-10-09 + * @update 2024-11-04 */ static SourceInfo os_fedora_sources[] = { - {&Upstream, NULL}, + {&Upstream, "http://download.example/pub/fedora/linux"}, {&Ali, "https://mirrors.aliyun.com/fedora"}, {&Bfsu, "https://mirrors.bfsu.edu.cn/fedora"}, {&Ustc, "https://mirrors.ustc.edu.cn/fedora"},