diff --git a/src/framework/struct.h b/src/framework/struct.h index e984893..caaf8d6 100644 --- a/src/framework/struct.h +++ b/src/framework/struct.h @@ -178,7 +178,7 @@ TargetRegisterInfo_t; #define chef_prep_this(t,op) Target_t *this = &t##_target; this->inited = true; chef_allow_##op(t); #define use_this(t) Target_t *this = &t##_target; -#define use_this_source(t) Target_t *this = &t##_target; Source_t source = chsrc_yield_source_and_confirm (this, option); +#define chsrc_use_this_source(t) Target_t *this = &t##_target; Source_t source = chsrc_yield_source_and_confirm (this, option); #define def_sources_begin() Source_t sources[] = { #define def_sources_end() }; \ diff --git a/src/recipe/lang/Clojure.c b/src/recipe/lang/Clojure.c index 96eafd5..e052f81 100644 --- a/src/recipe/lang/Clojure.c +++ b/src/recipe/lang/Clojure.c @@ -36,7 +36,7 @@ pl_clojure_prelude () void pl_clojure_setsrc (char *option) { - use_this_source(pl_clojure); + chsrc_use_this_source (pl_clojure); if (chsrc_in_local_mode()) { diff --git a/src/recipe/lang/Dart/Flutter.c b/src/recipe/lang/Dart/Flutter.c index 895713e..3fe1332 100644 --- a/src/recipe/lang/Dart/Flutter.c +++ b/src/recipe/lang/Dart/Flutter.c @@ -51,7 +51,7 @@ pl_dart_flutter_getsrc (char *option) void pl_dart_flutter_setsrc (char *option) { - use_this_source(pl_dart_flutter); + chsrc_use_this_source (pl_dart_flutter); char *w = NULL; char *cmd = NULL; diff --git a/src/recipe/lang/Dart/Pub.c b/src/recipe/lang/Dart/Pub.c index d0a685c..19c6078 100644 --- a/src/recipe/lang/Dart/Pub.c +++ b/src/recipe/lang/Dart/Pub.c @@ -47,7 +47,7 @@ pl_dart_getsrc (char *option) void pl_dart_setsrc (char *option) { - use_this_source(pl_dart); + chsrc_use_this_source (pl_dart); char *w = NULL; char *cmd = NULL; diff --git a/src/recipe/lang/Go.c b/src/recipe/lang/Go.c index 6d58e33..d3a2559 100644 --- a/src/recipe/lang/Go.c +++ b/src/recipe/lang/Go.c @@ -80,7 +80,7 @@ pl_go_setsrc (char *option) { pl_go_check_cmd (); - use_this_source(pl_go); + chsrc_use_this_source (pl_go); char *cmd = "go env -w GO111MODULE=on"; chsrc_run (cmd, RunOpt_Default); diff --git a/src/recipe/lang/Haskell.c b/src/recipe/lang/Haskell.c index ad6461b..f07e3c5 100644 --- a/src/recipe/lang/Haskell.c +++ b/src/recipe/lang/Haskell.c @@ -39,7 +39,7 @@ pl_haskell_prelude () void pl_haskell_setsrc (char *option) { - use_this_source(pl_haskell); + chsrc_use_this_source (pl_haskell); char *content = xy_str_gsub (RAWSTR_pl_haskell_cabal_config, "@url@", source.url); diff --git a/src/recipe/lang/Java.c b/src/recipe/lang/Java.c index 4d5eadd..47435be 100644 --- a/src/recipe/lang/Java.c +++ b/src/recipe/lang/Java.c @@ -77,7 +77,7 @@ pl_java_setsrc (char *option) bool maven_exist, gradle_exist; pl_java_check_cmd (&maven_exist, &gradle_exist); - use_this_source(pl_java); + chsrc_use_this_source (pl_java); if (maven_exist) { diff --git a/src/recipe/lang/JavaScript/JavaScript.c b/src/recipe/lang/JavaScript/JavaScript.c index 235c17c..0c9faef 100644 --- a/src/recipe/lang/JavaScript/JavaScript.c +++ b/src/recipe/lang/JavaScript/JavaScript.c @@ -70,7 +70,7 @@ pl_js_group_setsrc (char *option) chsrc_set_target_group_mode (); - use_this_source (pl_js_group); + chsrc_use_this_source (pl_js_group); if (npm_exist) { diff --git a/src/recipe/lang/Julia.c b/src/recipe/lang/Julia.c index f225b57..e8815fd 100644 --- a/src/recipe/lang/Julia.c +++ b/src/recipe/lang/Julia.c @@ -52,7 +52,7 @@ pl_julia_getsrc (char *option) void pl_julia_setsrc (char *option) { - use_this_source(pl_julia); + chsrc_use_this_source (pl_julia); char *w = xy_strcat (3, "ENV[\"JULIA_PKG_SERVER\"] = \"", source.url, "\""); diff --git a/src/recipe/lang/Lua.c b/src/recipe/lang/Lua.c index 738689d..42b179d 100644 --- a/src/recipe/lang/Lua.c +++ b/src/recipe/lang/Lua.c @@ -48,7 +48,7 @@ pl_lua_getsrc (char *option) void pl_lua_setsrc (char *option) { - use_this_source (pl_lua); + chsrc_use_this_source (pl_lua); char *config = xy_strcat (3, "rocks_servers = {\n" " \"", source.url, "\"\n" diff --git a/src/recipe/lang/OCaml.c b/src/recipe/lang/OCaml.c index a70cdd2..d5e064f 100644 --- a/src/recipe/lang/OCaml.c +++ b/src/recipe/lang/OCaml.c @@ -51,7 +51,7 @@ pl_ocaml_setsrc (char *option) { pl_ocaml_check_cmd (); - use_this_source(pl_ocaml); + chsrc_use_this_source (pl_ocaml); char *cmd = xy_strcat (3, "opam repo set-url default ", source.url, diff --git a/src/recipe/lang/PHP.c b/src/recipe/lang/PHP.c index 228beda..fbea3e7 100644 --- a/src/recipe/lang/PHP.c +++ b/src/recipe/lang/PHP.c @@ -55,7 +55,7 @@ pl_php_setsrc (char *option) { pl_php_check_cmd (); - use_this_source (pl_php); + chsrc_use_this_source (pl_php); char *where = " -g "; if (chsrc_in_local_mode()) diff --git a/src/recipe/lang/Perl.c b/src/recipe/lang/Perl.c index f107370..f998bb4 100644 --- a/src/recipe/lang/Perl.c +++ b/src/recipe/lang/Perl.c @@ -57,7 +57,7 @@ pl_perl_getsrc (char *option) void pl_perl_setsrc (char *option) { - use_this_source(pl_perl); + chsrc_use_this_source (pl_perl); char *cmd = xy_strcat (3, "perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('urllist', 'unshift', '", source.url, "'); CPAN::HandleConfig->commit()\""); diff --git a/src/recipe/lang/Python/Python.c b/src/recipe/lang/Python/Python.c index 0e4b4e5..e7809f0 100644 --- a/src/recipe/lang/Python/Python.c +++ b/src/recipe/lang/Python/Python.c @@ -58,7 +58,7 @@ pl_python_group_setsrc (char *option) chsrc_set_target_group_mode (); - use_this_source (pl_python_group); + chsrc_use_this_source (pl_python_group); // 交给后面检查命令的存在性 diff --git a/src/recipe/lang/R.c b/src/recipe/lang/R.c index 3583a6d..c259744 100644 --- a/src/recipe/lang/R.c +++ b/src/recipe/lang/R.c @@ -62,7 +62,7 @@ pl_r_getsrc (char *option) void pl_r_setsrc (char *option) { - use_this_source(pl_r); + chsrc_use_this_source (pl_r); char *bioconductor_url = xy_str_delete_suffix (xy_str_delete_suffix (source.url, "cran/"), "CRAN/"); bioconductor_url = xy_2strcat(bioconductor_url, "bioconductor"); diff --git a/src/recipe/lang/Ruby/Ruby.c b/src/recipe/lang/Ruby/Ruby.c index 00842f8..9fe7a11 100644 --- a/src/recipe/lang/Ruby/Ruby.c +++ b/src/recipe/lang/Ruby/Ruby.c @@ -69,7 +69,7 @@ pl_ruby_setsrc (char *option) { chsrc_ensure_program ("gem"); - use_this_source(pl_ruby); + chsrc_use_this_source (pl_ruby); char *cmd = NULL; diff --git a/src/recipe/lang/Rust/Cargo.c b/src/recipe/lang/Rust/Cargo.c index 770d9c2..940b5a8 100644 --- a/src/recipe/lang/Rust/Cargo.c +++ b/src/recipe/lang/Rust/Cargo.c @@ -62,7 +62,7 @@ pl_rust_cargo_getsrc (char *option) void pl_rust_cargo_setsrc (char *option) { - use_this_source(pl_rust_cargo); + chsrc_use_this_source (pl_rust_cargo); char *content = RAWSTR_pl_rust_cargo_config; diff --git a/src/recipe/lang/Rust/rustup.c b/src/recipe/lang/Rust/rustup.c index 401fb3f..2ad6364 100644 --- a/src/recipe/lang/Rust/rustup.c +++ b/src/recipe/lang/Rust/rustup.c @@ -56,7 +56,7 @@ pl_rust_rustup_getsrc (char *option) void pl_rust_rustup_setsrc (char *option) { - use_this_source(pl_rust_rustup); + chsrc_use_this_source (pl_rust_rustup); #ifdef XY_Build_On_Windows diff --git a/src/recipe/os/APT/Armbian.c b/src/recipe/os/APT/Armbian.c index 619a077..ce8e1d2 100644 --- a/src/recipe/os/APT/Armbian.c +++ b/src/recipe/os/APT/Armbian.c @@ -60,7 +60,7 @@ os_armbian_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_armbian); + chsrc_use_this_source (os_armbian); chsrc_backup (OS_Armbian_SourceList); diff --git a/src/recipe/os/APT/Debian.c b/src/recipe/os/APT/Debian.c index 01c871e..970e873 100644 --- a/src/recipe/os/APT/Debian.c +++ b/src/recipe/os/APT/Debian.c @@ -83,7 +83,7 @@ os_debian_does_old_sourcelist_use_cdrom (void) void os_debian_setsrc_for_deb822 (char *option) { - use_this_source(os_debian); + chsrc_use_this_source (os_debian); chsrc_backup (OS_Debian_SourceList_DEB822); @@ -144,7 +144,7 @@ os_debian_setsrc (char *option) } } - use_this_source(os_debian); + chsrc_use_this_source (os_debian); chsrc_alert2 ("如果遇到无法拉取 HTTPS 源的情况,请手动运行:"); say ("apt install apt-transport-https ca-certificates"); diff --git a/src/recipe/os/APT/Kali-Linux.c b/src/recipe/os/APT/Kali-Linux.c index 1e2be74..7b85209 100644 --- a/src/recipe/os/APT/Kali-Linux.c +++ b/src/recipe/os/APT/Kali-Linux.c @@ -47,7 +47,7 @@ os_kali_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_kali); + chsrc_use_this_source (os_kali); chsrc_backup (OS_Apt_SourceList); diff --git a/src/recipe/os/APT/Linux-Lite.c b/src/recipe/os/APT/Linux-Lite.c index 40c282f..5b951a6 100644 --- a/src/recipe/os/APT/Linux-Lite.c +++ b/src/recipe/os/APT/Linux-Lite.c @@ -46,7 +46,7 @@ os_linuxlite_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_linuxlite); + chsrc_use_this_source (os_linuxlite); chsrc_backup (OS_Apt_SourceList); diff --git a/src/recipe/os/APT/Linux-Mint.c b/src/recipe/os/APT/Linux-Mint.c index e18b2dc..36371cf 100644 --- a/src/recipe/os/APT/Linux-Mint.c +++ b/src/recipe/os/APT/Linux-Mint.c @@ -58,7 +58,7 @@ os_linuxmint_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_linuxmint); + chsrc_use_this_source (os_linuxmint); chsrc_backup (OS_LinuxMint_SourceList); diff --git a/src/recipe/os/APT/ROS.c b/src/recipe/os/APT/ROS.c index 10a94ee..fa38c24 100644 --- a/src/recipe/os/APT/ROS.c +++ b/src/recipe/os/APT/ROS.c @@ -55,7 +55,7 @@ os_ros_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_ros); + chsrc_use_this_source (os_ros); chsrc_backup (OS_ROS_SourceList); diff --git a/src/recipe/os/APT/Raspberry-Pi-OS.c b/src/recipe/os/APT/Raspberry-Pi-OS.c index 11dae96..182c51a 100644 --- a/src/recipe/os/APT/Raspberry-Pi-OS.c +++ b/src/recipe/os/APT/Raspberry-Pi-OS.c @@ -50,7 +50,7 @@ os_raspberrypi_setsrc (char *option) { chsrc_ensure_root(); // HELP: 不确定是否需要 - use_this_source(os_raspberrypi); + chsrc_use_this_source (os_raspberrypi); chsrc_backup (OS_RaspberryPi_SourceList); diff --git a/src/recipe/os/APT/Termux.c b/src/recipe/os/APT/Termux.c index 0b78b7d..a0b0eee 100644 --- a/src/recipe/os/APT/Termux.c +++ b/src/recipe/os/APT/Termux.c @@ -59,7 +59,7 @@ os_termux_setsrc (char *option) // chsrc_ensure_root (); Termux下禁止使用root - use_this_source(os_termux); + chsrc_use_this_source (os_termux); char *cmd = xy_strcat (3, "sed -i 's@^\\(deb.*stable main\\)$@#\\1\\ndeb ", source.url, "apt/termux-main stable main@' " OS_Termux_SourceList); diff --git a/src/recipe/os/APT/Trisquel.c b/src/recipe/os/APT/Trisquel.c index 6047c43..3ac2e79 100644 --- a/src/recipe/os/APT/Trisquel.c +++ b/src/recipe/os/APT/Trisquel.c @@ -51,7 +51,7 @@ os_trisquel_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_trisquel); + chsrc_use_this_source (os_trisquel); chsrc_backup (OS_Apt_SourceList); diff --git a/src/recipe/os/APT/Ubuntu.c b/src/recipe/os/APT/Ubuntu.c index c9b8a82..9c4f8a5 100644 --- a/src/recipe/os/APT/Ubuntu.c +++ b/src/recipe/os/APT/Ubuntu.c @@ -75,7 +75,7 @@ os_ubuntu_getsrc (char *option) void os_ubuntu_setsrc_for_deb822 (char *option) { - use_this_source(os_ubuntu); + chsrc_use_this_source (os_ubuntu); chsrc_backup (OS_Ubuntu_SourceList_DEB822); @@ -118,7 +118,7 @@ os_ubuntu_setsrc (char *option) bool sourcelist_exist = ensure_debian_or_ubuntu_old_sourcelist (OS_Is_Ubuntu); - use_this_source(os_ubuntu); + chsrc_use_this_source (os_ubuntu); /* 不存在的时候,用的是我们生成的无效文件,不要备份 */ if (sourcelist_exist) diff --git a/src/recipe/os/APT/deepin.c b/src/recipe/os/APT/deepin.c index 637ffa6..8f01ed1 100644 --- a/src/recipe/os/APT/deepin.c +++ b/src/recipe/os/APT/deepin.c @@ -53,7 +53,7 @@ os_deepin_setsrc (char *option) { chsrc_ensure_root(); - use_this_source(os_deepin); + chsrc_use_this_source (os_deepin); chsrc_backup (OS_Apt_SourceList); diff --git a/src/recipe/os/APT/openKylin.c b/src/recipe/os/APT/openKylin.c index 3201938..8d6ddd4 100644 --- a/src/recipe/os/APT/openKylin.c +++ b/src/recipe/os/APT/openKylin.c @@ -44,7 +44,7 @@ os_openkylin_setsrc (char *option) { chsrc_ensure_root(); - use_this_source(os_openkylin); + chsrc_use_this_source (os_openkylin); chsrc_backup (OS_Apt_SourceList); diff --git a/src/recipe/os/Alpine-Linux.c b/src/recipe/os/Alpine-Linux.c index 0183abc..f7e98bd 100644 --- a/src/recipe/os/Alpine-Linux.c +++ b/src/recipe/os/Alpine-Linux.c @@ -54,7 +54,7 @@ os_alpine_setsrc (char *option) { // chsrc_ensure_root(); // HELP: 不确定是否需要root - use_this_source(os_alpine); + chsrc_use_this_source (os_alpine); char* cmd = xy_strcat (3, "sed -i 's#https\\?://dl-cdn.alpinelinux.org/alpine#", source.url, "#g' /etc/apk/repositories" diff --git a/src/recipe/os/BSD/NetBSD.c b/src/recipe/os/BSD/NetBSD.c index 87f4f36..5358312 100644 --- a/src/recipe/os/BSD/NetBSD.c +++ b/src/recipe/os/BSD/NetBSD.c @@ -58,7 +58,7 @@ os_netbsd_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_netbsd); + chsrc_use_this_source (os_netbsd); chsrc_backup ("/usr/pkg/etc/pkgin/repositories.conf"); diff --git a/src/recipe/os/BSD/OpenBSD.c b/src/recipe/os/BSD/OpenBSD.c index e5d61fc..b099822 100644 --- a/src/recipe/os/BSD/OpenBSD.c +++ b/src/recipe/os/BSD/OpenBSD.c @@ -57,7 +57,7 @@ os_openbsd_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_openbsd); + chsrc_use_this_source (os_openbsd); chsrc_backup ("/etc/installurl"); chsrc_overwrite_file (source.url, "/etc/installurl"); diff --git a/src/recipe/os/Gentoo-Linux.c b/src/recipe/os/Gentoo-Linux.c index 4e5d3a3..4e25fdb 100644 --- a/src/recipe/os/Gentoo-Linux.c +++ b/src/recipe/os/Gentoo-Linux.c @@ -42,7 +42,7 @@ os_gentoo_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_gentoo); + chsrc_use_this_source (os_gentoo); chsrc_backup ("/etc/portage/repos.conf/gentoo.conf"); diff --git a/src/recipe/os/OpenWrt.c b/src/recipe/os/OpenWrt.c index 36315e8..19643ab 100644 --- a/src/recipe/os/OpenWrt.c +++ b/src/recipe/os/OpenWrt.c @@ -57,7 +57,7 @@ os_openwrt_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_openwrt); + chsrc_use_this_source (os_openwrt); chsrc_backup (OS_OpenWRT_SourceConfig); diff --git a/src/recipe/os/Solus.c b/src/recipe/os/Solus.c index 1ec4bbd..989da7b 100644 --- a/src/recipe/os/Solus.c +++ b/src/recipe/os/Solus.c @@ -41,7 +41,7 @@ os_solus_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_solus); + chsrc_use_this_source (os_solus); char *cmd = xy_2strcat ("eopkg add-repo Solus ", source.url); chsrc_run (cmd, RunOpt_Default); diff --git a/src/recipe/os/Void-Linux.c b/src/recipe/os/Void-Linux.c index 12c0fa4..ace7dd6 100644 --- a/src/recipe/os/Void-Linux.c +++ b/src/recipe/os/Void-Linux.c @@ -49,7 +49,7 @@ os_voidlinux_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_voidlinux); + chsrc_use_this_source (os_voidlinux); chsrc_ensure_dir ("/etc/xbps.d"); char *cmd = "cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/"; diff --git a/src/recipe/os/YUM/AlmaLinux.c b/src/recipe/os/YUM/AlmaLinux.c index 3b5b509..95a7224 100644 --- a/src/recipe/os/YUM/AlmaLinux.c +++ b/src/recipe/os/YUM/AlmaLinux.c @@ -43,7 +43,7 @@ os_almalinux_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_almalinux); + chsrc_use_this_source (os_almalinux); char *cmd = xy_strcat (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"); diff --git a/src/recipe/os/YUM/Anolis-OS.c b/src/recipe/os/YUM/Anolis-OS.c index 38f0e9f..6761ef7 100644 --- a/src/recipe/os/YUM/Anolis-OS.c +++ b/src/recipe/os/YUM/Anolis-OS.c @@ -39,7 +39,7 @@ os_anolis_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_anolis); + chsrc_use_this_source (os_anolis); char *cmd = xy_strcat (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo"); chsrc_run (cmd, RunOpt_Default); diff --git a/src/recipe/os/YUM/Fedora-Linux.c b/src/recipe/os/YUM/Fedora-Linux.c index 6cd61f2..9abbed9 100644 --- a/src/recipe/os/YUM/Fedora-Linux.c +++ b/src/recipe/os/YUM/Fedora-Linux.c @@ -50,7 +50,7 @@ os_fedora_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_fedora); + chsrc_use_this_source (os_fedora); chsrc_alert2 ("Fedora 38 及以下版本暂不支持"); diff --git a/src/recipe/os/YUM/Rocky-Linux.c b/src/recipe/os/YUM/Rocky-Linux.c index 96a9d48..db748d7 100644 --- a/src/recipe/os/YUM/Rocky-Linux.c +++ b/src/recipe/os/YUM/Rocky-Linux.c @@ -46,7 +46,7 @@ os_rockylinux_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_rockylinux); + chsrc_use_this_source (os_rockylinux); char *version_str = xy_run ("sed -nr 's/ROCKY_SUPPORT_PRODUCT_VERSION=\"(.*)\"/\\1/p' " ETC_OS_RELEASE, 0); double version = atof (version_str); diff --git a/src/recipe/os/YUM/openEuler.c b/src/recipe/os/YUM/openEuler.c index 3670f65..f7a2517 100644 --- a/src/recipe/os/YUM/openEuler.c +++ b/src/recipe/os/YUM/openEuler.c @@ -60,7 +60,7 @@ os_openeuler_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_openeuler); + chsrc_use_this_source (os_openeuler); chsrc_backup (OS_openEuler_SourceList); diff --git a/src/recipe/os/openSUSE.c b/src/recipe/os/openSUSE.c index 6573850..bb5052f 100644 --- a/src/recipe/os/openSUSE.c +++ b/src/recipe/os/openSUSE.c @@ -43,7 +43,7 @@ os_opensuse_setsrc (char *option) { // chsrc_ensure_root (); - use_this_source(os_opensuse); + chsrc_use_this_source (os_opensuse); while (1) { chsrc_note2 ("请选择你的操作系统为:"); diff --git a/src/recipe/os/pacman/Arch-Linux.c b/src/recipe/os/pacman/Arch-Linux.c index e9f695b..725e152 100644 --- a/src/recipe/os/pacman/Arch-Linux.c +++ b/src/recipe/os/pacman/Arch-Linux.c @@ -66,7 +66,7 @@ os_arch_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_arch); + chsrc_use_this_source (os_arch); chsrc_backup (OS_Pacman_MirrorList); @@ -162,7 +162,7 @@ os_archlinuxcn_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(os_archlinuxcn); + chsrc_use_this_source (os_archlinuxcn); chsrc_backup (OS_Pacman_ArchLinuxCN_MirrorList); diff --git a/src/recipe/os/pacman/MSYS2.c b/src/recipe/os/pacman/MSYS2.c index 49e31b6..825d454 100644 --- a/src/recipe/os/pacman/MSYS2.c +++ b/src/recipe/os/pacman/MSYS2.c @@ -43,7 +43,7 @@ os_msys2_prelude () void os_msys2_setsrc (char *option) { - use_this_source(os_msys2); + chsrc_use_this_source (os_msys2); chsrc_backup ("/etc/pacman.d/mirrorlist.mingw32"); chsrc_backup ("/etc/pacman.d/mirrorlist.mingw64"); diff --git a/src/recipe/recipe-template.c b/src/recipe/recipe-template.c index 729409f..8f75e26 100644 --- a/src/recipe/recipe-template.c +++ b/src/recipe/recipe-template.c @@ -112,7 +112,7 @@ void __setsrc (char *option) { /* 下面这行是必须的,注入 source 变量 */ - use_this_source(_); + chsrc_use_this_source (_); /* 如果是 target group,你可能想要指定不同的 target 来使用它的源 */ // Source_t source = chsrc_yield_source_and_confirm (&pl_js_group_target, option); diff --git a/src/recipe/ware/Anaconda/Anaconda.c b/src/recipe/ware/Anaconda/Anaconda.c index 3b8bbb6..6faba38 100644 --- a/src/recipe/ware/Anaconda/Anaconda.c +++ b/src/recipe/ware/Anaconda/Anaconda.c @@ -52,7 +52,7 @@ wr_anaconda_getsrc (char *option) void wr_anaconda_setsrc (char *option) { - use_this_source(wr_anaconda); + chsrc_use_this_source (wr_anaconda); char *w = xy_str_gsub (RAWSTR_wr_anaconda_condarc, "@1@", source.url); diff --git a/src/recipe/ware/CocoaPods.c b/src/recipe/ware/CocoaPods.c index 108db3a..88f4f78 100644 --- a/src/recipe/ware/CocoaPods.c +++ b/src/recipe/ware/CocoaPods.c @@ -38,7 +38,7 @@ wr_cocoapods_prelude () void wr_cocoapods_setsrc (char *option) { - use_this_source(wr_cocoapods); + chsrc_use_this_source (wr_cocoapods); chsrc_note2 ("请手动执行以下命令:"); p("cd ~/.cocoapods/repos"); diff --git a/src/recipe/ware/Docker/Docker.c b/src/recipe/ware/Docker/Docker.c index aa119c8..65bd54a 100644 --- a/src/recipe/ware/Docker/Docker.c +++ b/src/recipe/ware/Docker/Docker.c @@ -71,7 +71,7 @@ wr_docker_setsrc (char *option) { chsrc_ensure_root (); - use_this_source(wr_docker); + chsrc_use_this_source (wr_docker); if (xy_on_linux || xy_on_bsd) { diff --git a/src/recipe/ware/Emacs.c b/src/recipe/ware/Emacs.c index a983f4c..d0b7e84 100644 --- a/src/recipe/ware/Emacs.c +++ b/src/recipe/ware/Emacs.c @@ -47,7 +47,7 @@ wr_emacs_prelude () void wr_emacs_setsrc (char *option) { - use_this_source(wr_emacs); + chsrc_use_this_source (wr_emacs); chsrc_note2 ("Emacs换源涉及Elisp, 需要手动查阅并换源:"); p (source.url); diff --git a/src/recipe/ware/Flatpak.c b/src/recipe/ware/Flatpak.c index fd2d13b..0163298 100644 --- a/src/recipe/ware/Flatpak.c +++ b/src/recipe/ware/Flatpak.c @@ -63,7 +63,7 @@ wr_flatpak_getsrc (char *option) void wr_flatpak_setsrc (char *option) { - use_this_source(wr_flatpak); + chsrc_use_this_source (wr_flatpak); chsrc_alert2 ("若出现问题,可先调用以下命令:"); char *note = xy_strcat (3, diff --git a/src/recipe/ware/Guix.c b/src/recipe/ware/Guix.c index d6497db..a31483a 100644 --- a/src/recipe/ware/Guix.c +++ b/src/recipe/ware/Guix.c @@ -37,7 +37,7 @@ wr_guix_prelude () void wr_guix_setsrc (char *option) { - use_this_source(wr_guix); + chsrc_use_this_source (wr_guix); char *file = xy_strcat (3, "(list (channel\n" " (inherit (car %default-channels))\n" diff --git a/src/recipe/ware/Homebrew/Homebrew.c b/src/recipe/ware/Homebrew/Homebrew.c index 665d86c..cc76335 100644 --- a/src/recipe/ware/Homebrew/Homebrew.c +++ b/src/recipe/ware/Homebrew/Homebrew.c @@ -53,7 +53,7 @@ wr_homebrew_getsrc (char *option) void wr_homebrew_setsrc (char *option) { - use_this_source(wr_homebrew); + chsrc_use_this_source (wr_homebrew); char *w = xy_str_gsub (RAWSTR_wr_homebrew_config_in_bash, "@1@", source.url); diff --git a/src/recipe/ware/Nix.c b/src/recipe/ware/Nix.c index 7aca1a9..b39379c 100644 --- a/src/recipe/ware/Nix.c +++ b/src/recipe/ware/Nix.c @@ -50,7 +50,7 @@ wr_nix_setsrc (char *option) { wr_nix_check_cmd (); - use_this_source(wr_nix); + chsrc_use_this_source (wr_nix); char *cmd = xy_strcat (3, "nix-channel --add ", source.url, "nixpkgs-unstable nixpkgs"); chsrc_run (cmd, RunOpt_Default); diff --git a/src/recipe/ware/TeX-Live.c b/src/recipe/ware/TeX-Live.c index fa034ac..b267159 100644 --- a/src/recipe/ware/TeX-Live.c +++ b/src/recipe/ware/TeX-Live.c @@ -82,7 +82,7 @@ wr_tex_setsrc (char *option) bool tlmgr_exist, mpm_exist; wr_tex_check_cmd (&tlmgr_exist, &mpm_exist); - use_this_source(wr_tex); + chsrc_use_this_source (wr_tex); char *cmd = NULL; diff --git a/src/recipe/ware/WinGet.c b/src/recipe/ware/WinGet.c index 8f08ac8..a05f2a8 100644 --- a/src/recipe/ware/WinGet.c +++ b/src/recipe/ware/WinGet.c @@ -44,7 +44,7 @@ wr_winget_getsrc (char *option) void wr_winget_setsrc (char *option) { - use_this_source (wr_winget); + chsrc_use_this_source (wr_winget); // 2025.8.17 此前用户可能隐式使用默认源导致 remove 失败,故使用 Dont_Abort chsrc_run ("winget source remove winget", RunOpt_Dont_Abort_On_Failure);