mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-11 07:03:34 +08:00
Adjust chsrc_conclude()
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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 均会覆写我们刚才换源的内容");
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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};
|
||||
|
Reference in New Issue
Block a user