Rename inner function

This commit is contained in:
Aoran Zeng
2024-08-18 09:27:22 +08:00
parent 15d9ba817e
commit eba633b6e4
55 changed files with 123 additions and 231 deletions

View File

@@ -29,16 +29,14 @@ os_almalinux_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_almalinux);
chsrc_confirm_source (&source);
chsrc_yield_source_and_confirm (os_almalinux);
char *cmd = xy_strjoin (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#\\s*baseurl=https://repo.almalinux.org/almalinux|baseurl=", source.url, "|g' -i.bak /etc/yum.repos.d/almalinux*.repo");
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_say_lastly (&source, ChsrcTypeAuto);
chsrc_conclude (&source, ChsrcTypeAuto);
}
def_target_s(os_almalinux);

View File

@@ -29,16 +29,14 @@ os_anolis_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_anolis);
chsrc_confirm_source (&source);
chsrc_yield_source_and_confirm (os_anolis);
char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("dnf makecache", RunOpt_Default);
chsrc_run ("dnf update", RunOpt_No_Last_New_Line);
chsrc_say_lastly (&source, ChsrcTypeUntested);
chsrc_conclude (&source, ChsrcTypeUntested);
}
def_target_s(os_anolis);

View File

@@ -35,9 +35,7 @@ os_fedora_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_fedora);
chsrc_confirm_source (&source);
chsrc_yield_source_and_confirm (os_fedora);
chsrc_note2 ("Fedora 29 及以下版本暂不支持");
@@ -62,7 +60,7 @@ os_fedora_setsrc (char *option)
chsrc_log2 ("已新增文件 /etc/yum.repos.d/fedora-updates-modular.repo");
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_say_lastly (&source, ChsrcTypeAuto);
chsrc_conclude (&source, ChsrcTypeAuto);
}
def_target_s(os_fedora);

View File

@@ -33,9 +33,7 @@ os_rockylinux_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_rockylinux);
chsrc_confirm_source (&source);
chsrc_yield_source_and_confirm (os_rockylinux);
char *cmd = xy_strjoin (3,
"sed -e 's|^mirrorlist=|#mirrorlist=|g' "
@@ -44,7 +42,7 @@ os_rockylinux_setsrc (char *option)
);
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_say_lastly (&source, ChsrcTypeUntested);
chsrc_conclude (&source, ChsrcTypeUntested);
}
def_target_s(os_rockylinux);

View File

@@ -32,9 +32,7 @@ os_openeuler_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_openeuler);
chsrc_confirm_source (&source);
chsrc_yield_source_and_confirm (os_openeuler);
chsrc_backup (OS_openEuler_SourceList);
@@ -45,7 +43,7 @@ os_openeuler_setsrc (char *option)
chsrc_overwrite_file (towrite, OS_openEuler_SourceList);
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_say_lastly (&source, ChsrcTypeAuto);
chsrc_conclude (&source, ChsrcTypeAuto);
}
def_target_s(os_openeuler);