Adjust chsrc_conclude()

This commit is contained in:
Aoran Zeng
2024-11-22 09:08:32 +08:00
parent 6a59ec51e1
commit 722de55ecb
65 changed files with 234 additions and 124 deletions

View File

@@ -57,7 +57,9 @@ os_armbian_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}

View File

@@ -66,7 +66,9 @@ os_debian_setsrc_for_deb822 (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
@@ -105,7 +107,9 @@ os_debian_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}

View File

@@ -53,7 +53,9 @@ os_kali_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_kali);

View File

@@ -42,7 +42,9 @@ os_linuxlite_setsrc (char *option)
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/.*/?@", source.url, "@g' " OS_Apt_SourceList);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
def_target(os_linuxlite);

View File

@@ -54,7 +54,9 @@ os_linuxmint_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
chsrc_warn2 ("完成后请不要再使用 mintsources自带的图形化软件源设置工具进行任何操作因为在操作后无论是否有按“确定”mintsources 均会覆写我们刚才换源的内容");
}

View File

@@ -46,7 +46,9 @@ os_ros_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target_s(os_ros);

View File

@@ -44,7 +44,9 @@ os_raspberrypi_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_raspberrypi);

View File

@@ -46,7 +46,9 @@ os_trisquel_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_trisquel);

View File

@@ -75,7 +75,9 @@ os_ubuntu_setsrc_for_deb822 (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
/**
@@ -118,7 +120,9 @@ os_ubuntu_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}

View File

@@ -51,7 +51,9 @@ os_deepin_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_deepin);

View File

@@ -39,7 +39,9 @@ os_openkylin_setsrc (char *option)
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/openkylin/?@", source.url, "@g'" OS_Apt_SourceList);
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_openkylin);

View File

@@ -48,7 +48,9 @@ os_alpine_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apk update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_alpine);

View File

@@ -128,7 +128,8 @@ os_freebsd_setsrc (char *option)
chsrc_overwrite_file (update, "/etc/freebsd-update.conf");
*/
chsrc_conclude (&source, SetsrcType_SemiAuto);
ProgMode_ChgType = ChgType_SemiAuto;
chsrc_conclude (&source);
}
def_target_s(os_freebsd);

View File

@@ -58,7 +58,8 @@ os_netbsd_setsrc (char *option)
char *url = xy_strjoin (5, source.url, arch, "/", version, "/All");
chsrc_overwrite_file (url, "/usr/pkg/etc/pkgin/repositories.conf");
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_netbsd);

View File

@@ -47,7 +47,8 @@ os_openbsd_setsrc (char *option)
chsrc_backup ("/etc/installurl");
chsrc_overwrite_file (source.url, "/etc/installurl");
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_openbsd);

View File

@@ -45,7 +45,9 @@ os_gentoo_setsrc (char *option)
char *w = xy_strjoin (3, "GENTOO_MIRRORS=\"https://", source.url, "gentoo\"\n");
chsrc_append_to_file (w, "/etc/portage/make.conf");
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target_s(os_gentoo);

View File

@@ -50,7 +50,9 @@ os_openwrt_setsrc (char *option)
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*downloads.openwrt.org@", source.url, "@g' " OS_OpenWRT_SourceConfig);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}

View File

@@ -32,7 +32,9 @@ os_solus_setsrc (char *option)
char *cmd = xy_2strjoin ("eopkg add-repo Solus ", source.url);
chsrc_run (cmd, RunOpt_Default);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
def_target_s(os_solus);

View File

@@ -52,7 +52,8 @@ os_void_setsrc (char *option)
chsrc_note2 ("若报错可尝试使用以下命令:");
say (cmd);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target(os_void);

View File

@@ -36,7 +36,9 @@ os_almalinux_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
def_target_s(os_almalinux);

View File

@@ -36,7 +36,9 @@ os_anolis_setsrc (char *option)
chsrc_run ("dnf makecache", RunOpt_Default);
chsrc_run ("dnf update", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target_s(os_anolis);

View File

@@ -37,8 +37,6 @@ def_sources_n(os_fedora);
void
os_fedora_setsrc (char *option)
{
char *setsrc_type = xy_streql (option, SetsrcType_Reset) ? SetsrcType_Reset : SetsrcType_Auto;
chsrc_ensure_root ();
chsrc_yield_source_and_confirm (os_fedora);
@@ -74,14 +72,15 @@ os_fedora_setsrc (char *option)
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, setsrc_type);
ProgMode_ChgType = ProgMode_CMD_Reset ? ChgType_Reset : ChgType_Auto;
chsrc_conclude (&source);
}
void
os_fedora_resetsrc (char *option)
{
os_fedora_setsrc (SetsrcType_Reset);
os_fedora_setsrc (option);
}

View File

@@ -67,7 +67,9 @@ os_rockylinux_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}

View File

@@ -44,7 +44,9 @@ os_openeuler_setsrc (char *option)
chsrc_overwrite_file (towrite, OS_openEuler_SourceList);
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
def_target_s(os_openeuler);

View File

@@ -75,7 +75,9 @@ os_opensuse_setsrc (char *option)
chsrc_run (cmd5, RunOpt_Default);
chsrc_run (cmd6, RunOpt_Default);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target_s(os_opensuse);

View File

@@ -91,7 +91,8 @@ os_arch_setsrc (char *option)
{
chsrc_run ("pacman -Syy", RunOpt_No_Last_New_Line);
}
chsrc_conclude (&source, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
@@ -124,7 +125,9 @@ os_archlinuxcn_setsrc (char *option)
chsrc_run ("pacman -Sy archlinuxcn-keyring", RunOpt_Default);
chsrc_run ("pacman -Syy", RunOpt_No_Last_New_Line);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
#undef OS_Pacman_MirrorList

View File

@@ -47,7 +47,9 @@ os_msys2_setsrc (char *option)
"#g\" /etc/pacman.d/mirrorlist* ");
chsrc_run (cmd, RunOpt_Default);
chsrc_conclude (&source, SetsrcType_Untested);
ProgMode_ChgType = ChgType_Untested;
chsrc_conclude (&source);
}
def_target_s(os_msys2);

View File

@@ -20,7 +20,8 @@ os_manjaro_setsrc (char *option)
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("pacman -Syy", RunOpt_No_Last_New_Line);
chsrc_conclude (NULL, SetsrcType_Auto);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (NULL);
}
Target_t os_manjaro_target = {NULL, os_manjaro_setsrc, NULL, NULL, 0};