mirror of
https://github.com/RubyMetric/chsrc.git
synced 2024-11-23 09:17:55 +08:00
Update inner macro
This commit is contained in:
parent
ffaee0b0c3
commit
2a52c898d6
|
@ -701,13 +701,13 @@ source_has_empty_url (SourceInfo *source)
|
|||
* 1. 用户指定某个 MirrorCode
|
||||
* 2. NULL: 用户什么都没指定 (将测速选择最快镜像)
|
||||
* 3. 用户给了一个 URL
|
||||
* 4. ChsrcTypeReset
|
||||
* 4. SetsrcType_Reset
|
||||
* 选用了Leader target
|
||||
* 5. ProgMode_Leader_Selected_Index 将给出所选索引
|
||||
*
|
||||
* @dependency 变量 option
|
||||
*/
|
||||
#define chsrc_yield_the_source(for_what) \
|
||||
#define chsrc_yield_for_the_source(for_what) \
|
||||
if (ProgMode_Target_Group==true && ProgMode_Leader_Selected_Index==-1) \
|
||||
{ \
|
||||
ProgMode_Leader_Selected_Index = use_specific_mirror_or_auto_select (option, for_what); \
|
||||
|
@ -730,7 +730,7 @@ source_has_empty_url (SourceInfo *source)
|
|||
|
||||
#define chsrc_yield_source(for_what) \
|
||||
SourceInfo source; \
|
||||
chsrc_yield_the_source(for_what)
|
||||
chsrc_yield_for_the_source(for_what)
|
||||
|
||||
|
||||
|
||||
|
@ -778,11 +778,11 @@ confirm_source (SourceInfo *source)
|
|||
#define chsrc_yield_source_and_confirm(for_what) chsrc_yield_source(for_what);chsrc_confirm_source
|
||||
|
||||
|
||||
#define ChsrcTypeAuto "auto"
|
||||
#define ChsrcTypeReset "reset"
|
||||
#define ChsrcTypeSemiAuto "semiauto"
|
||||
#define ChsrcTypeManual "manual"
|
||||
#define ChsrcTypeUntested "untested"
|
||||
#define SetsrcType_Auto "auto"
|
||||
#define SetsrcType_Reset "reset"
|
||||
#define SetsrcType_SemiAuto "semiauto"
|
||||
#define SetsrcType_Manual "manual"
|
||||
#define SetsrcType_Untested "untested"
|
||||
|
||||
#define MSG_EN_PUBLIC_URL "If the URL you specify is a public service, you are invited to contribute: chsrc issue"
|
||||
#define MSG_CN_PUBLIC_URL "若您指定的URL为公有服务,邀您参与贡献: chsrc issue"
|
||||
|
@ -809,7 +809,7 @@ confirm_source (SourceInfo *source)
|
|||
|
||||
/**
|
||||
* @param source 可为NULL
|
||||
* @param last_word 5种选择:ChsrcTypeAuto | ChsrcTypeReset | ChsrcTypeSemiAuto | ChsrcTypeManual | ChsrcTypeUntested
|
||||
* @param last_word 5种选择:SetsrcType_Auto | SetsrcType_Reset | SetsrcType_SemiAuto | SetsrcType_Manual | SetsrcType_Untested
|
||||
* @translation Done
|
||||
*/
|
||||
void
|
||||
|
@ -817,7 +817,7 @@ chsrc_conclude (SourceInfo *source, const char *last_word)
|
|||
{
|
||||
split_between_source_changing_process;
|
||||
|
||||
if (xy_streql (ChsrcTypeAuto, last_word))
|
||||
if (xy_streql (SetsrcType_Auto, last_word))
|
||||
{
|
||||
if (source)
|
||||
{
|
||||
|
@ -840,13 +840,13 @@ chsrc_conclude (SourceInfo *source, const char *last_word)
|
|||
chsrc_log (msg);
|
||||
}
|
||||
}
|
||||
else if (xy_streql (ChsrcTypeReset, last_word))
|
||||
else if (xy_streql (SetsrcType_Reset, last_word))
|
||||
{
|
||||
// source_is_upstream (source)
|
||||
char *msg = CliOpt_InEnglish ? "Has been reset to the upstream default source" : "已重置为上游默认源";
|
||||
chsrc_log (purple (msg));
|
||||
}
|
||||
else if (xy_streql (ChsrcTypeSemiAuto, last_word))
|
||||
else if (xy_streql (SetsrcType_SemiAuto, last_word))
|
||||
{
|
||||
if (source)
|
||||
{
|
||||
|
@ -873,7 +873,7 @@ chsrc_conclude (SourceInfo *source, const char *last_word)
|
|||
char *msg = CliOpt_InEnglish ? MSG_EN_BETTER : MSG_CN_BETTER;
|
||||
chsrc_warn (msg);
|
||||
}
|
||||
else if (xy_streql (ChsrcTypeManual, last_word))
|
||||
else if (xy_streql (SetsrcType_Manual, last_word))
|
||||
{
|
||||
if (source)
|
||||
{
|
||||
|
@ -898,7 +898,7 @@ chsrc_conclude (SourceInfo *source, const char *last_word)
|
|||
char *msg = CliOpt_InEnglish ? MSG_EN_BETTER : MSG_CN_BETTER;
|
||||
chsrc_warn (msg);
|
||||
}
|
||||
else if (xy_streql (ChsrcTypeUntested, last_word))
|
||||
else if (xy_streql (SetsrcType_Untested, last_word))
|
||||
{
|
||||
if (source)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ pl_clojure_setsrc (char *option)
|
|||
|
||||
chsrc_note2 ("抱歉,Clojure换源较复杂,您可手动查阅并换源:");
|
||||
puts (source.url);
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target_s (pl_clojure);
|
||||
|
|
|
@ -82,7 +82,7 @@ pl_dart_flutter_setsrc (char *option)
|
|||
chsrc_append_to_file (towrite, bashrc);
|
||||
}
|
||||
}
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ pl_dart_setsrc (char *option)
|
|||
chsrc_append_to_file (towrite, bashrc);
|
||||
}
|
||||
}
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ pl_go_setsrc (char *option)
|
|||
|
||||
cmd = xy_strjoin (3, "go env -w GOPROXY=", source.url, ",direct");
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target(pl_go);
|
||||
|
|
|
@ -62,7 +62,7 @@ pl_haskell_setsrc (char *option)
|
|||
|
||||
chsrc_note2 (xy_strjoin (3, "请向 ", config, " 中手动添加:"));
|
||||
puts (file);
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target_s (pl_haskell);
|
||||
|
|
|
@ -95,7 +95,7 @@ pl_java_setsrc (char *option)
|
|||
chsrc_note2 ("请在您的 build.gradle 中添加:");
|
||||
puts (file);
|
||||
}
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target(pl_java);
|
||||
|
|
|
@ -47,7 +47,7 @@ pl_julia_setsrc (char *option)
|
|||
const char *towrite = xy_strjoin (3, "ENV[\"JULIA_PKG_SERVER\"] = \"", source.url, "\"");
|
||||
|
||||
chsrc_append_to_file (towrite, "~/.julia/config/startup.jl");
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(pl_julia);
|
||||
|
|
|
@ -51,7 +51,7 @@ pl_lua_setsrc (char *option)
|
|||
chsrc_note2 ("请手动修改 ~/.luarocks/upload_config.lua 文件 (用于上传):");
|
||||
puts (upload_config);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target(pl_lua);
|
||||
|
|
|
@ -26,7 +26,7 @@ pl_nodejs_bun_getsrc (char *option)
|
|||
void
|
||||
pl_nodejs_bun_setsrc (char *option)
|
||||
{
|
||||
char *chsrc_type = xy_streql (option, ChsrcTypeReset) ? ChsrcTypeReset : ChsrcTypeManual;
|
||||
char *chsrc_type = xy_streql (option, SetsrcType_Reset) ? SetsrcType_Reset : SetsrcType_Manual;
|
||||
chsrc_yield_source (pl_nodejs);
|
||||
|
||||
char *file = xy_strjoin(3, "[install]\n"
|
||||
|
@ -45,7 +45,7 @@ pl_nodejs_bun_setsrc (char *option)
|
|||
void
|
||||
pl_nodejs_bun_resetsrc (char *option)
|
||||
{
|
||||
pl_nodejs_bun_setsrc (ChsrcTypeReset);
|
||||
pl_nodejs_bun_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ pl_nodejs_setsrc (char *option)
|
|||
pl_nodejs_pnpm_setsrc (option);
|
||||
}
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +103,7 @@ pl_nodejs_setsrc (char *option)
|
|||
void
|
||||
pl_nodejs_resetsrc (char *option)
|
||||
{
|
||||
pl_nodejs_setsrc (ChsrcTypeReset);
|
||||
pl_nodejs_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ void
|
|||
pl_nodejs_yarn_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_the_source (pl_nodejs);
|
||||
chsrc_yield_for_the_source (pl_nodejs);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
||||
|
@ -72,7 +72,7 @@ pl_nodejs_yarn_setsrc (char *option)
|
|||
}
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@ pl_nodejs_yarn_setsrc (char *option)
|
|||
void
|
||||
pl_nodejs_yarn_resetsrc (char *option)
|
||||
{
|
||||
pl_nodejs_yarn_setsrc (ChsrcTypeReset);
|
||||
pl_nodejs_yarn_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ void
|
|||
pl_nodejs_npm_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_the_source (pl_nodejs);
|
||||
chsrc_yield_for_the_source (pl_nodejs);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
||||
|
@ -41,7 +41,7 @@ pl_nodejs_npm_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ pl_nodejs_npm_setsrc (char *option)
|
|||
void
|
||||
pl_nodejs_npm_resetsrc (char *option)
|
||||
{
|
||||
pl_nodejs_npm_setsrc (ChsrcTypeReset);
|
||||
pl_nodejs_npm_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ pl_nodejs_nvm_setsrc (char *option)
|
|||
if (xy_file_exist (zshrc))
|
||||
chsrc_append_to_file (env, zshrc);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ pl_nodejs_nvm_setsrc (char *option)
|
|||
void
|
||||
pl_nodejs_nvm_resetsrc (char *option)
|
||||
{
|
||||
// pl_nodejs_nvm_setsrc (ChsrcTypeReset);
|
||||
// pl_nodejs_nvm_setsrc (SetsrcType_Reset);
|
||||
chsrc_error ("暂不支持对 nvm 重置");
|
||||
exit (Exit_Unsupported);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ void
|
|||
pl_nodejs_pnpm_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_the_source (pl_nodejs);
|
||||
chsrc_yield_for_the_source (pl_nodejs);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
||||
|
@ -42,7 +42,7 @@ pl_nodejs_pnpm_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ pl_nodejs_pnpm_setsrc (char *option)
|
|||
void
|
||||
pl_nodejs_pnpm_resetsrc (char *option)
|
||||
{
|
||||
pl_nodejs_pnpm_setsrc (ChsrcTypeReset);
|
||||
pl_nodejs_pnpm_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ pl_ocaml_setsrc(char *option)
|
|||
chsrc_note2 ("如果是首次使用 opam ,请使用以下命令进行初始化");
|
||||
puts (xy_2strjoin ("opam init default ", source.url));
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeSemiAuto);
|
||||
chsrc_conclude (&source, SetsrcType_SemiAuto);
|
||||
}
|
||||
|
||||
def_target(pl_ocaml);
|
||||
|
|
|
@ -57,7 +57,7 @@ pl_php_setsrc (char *option)
|
|||
char *cmd = xy_strjoin (4, "composer config", where, "repo.packagist composer ", source.url);
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeSemiAuto);
|
||||
chsrc_conclude (&source, SetsrcType_SemiAuto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ pl_perl_setsrc (char *option)
|
|||
|
||||
chsrc_note2 ("请您使用 perl -v 以及 cpan -v,若 Perl >= v5.36 或 CPAN >= 2.29,请额外手动调用下面的命令");
|
||||
puts ("perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('pushy_https', 0);; CPAN::HandleConfig->commit()\"");
|
||||
chsrc_conclude (&source, ChsrcTypeSemiAuto);
|
||||
chsrc_conclude (&source, SetsrcType_SemiAuto);
|
||||
}
|
||||
|
||||
def_target(pl_perl);
|
||||
|
|
|
@ -29,7 +29,7 @@ void
|
|||
pl_python_pdm_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_the_source (pl_python);
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
||||
|
@ -43,7 +43,7 @@ pl_python_pdm_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ pl_python_pdm_setsrc (char *option)
|
|||
void
|
||||
pl_python_pdm_resetsrc (char *option)
|
||||
{
|
||||
pl_python_pdm_setsrc (ChsrcTypeReset);
|
||||
pl_python_pdm_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ void
|
|||
pl_python_poetry_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
chsrc_yield_the_source (pl_python);
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
||||
|
@ -41,7 +41,7 @@ pl_python_poetry_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ pl_python_poetry_setsrc (char *option)
|
|||
void
|
||||
pl_python_poetry_resetsrc (char *option)
|
||||
{
|
||||
pl_python_poetry_setsrc (ChsrcTypeReset);
|
||||
pl_python_poetry_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ pl_python_setsrc (char *option)
|
|||
chsrc_note2 (msg);
|
||||
}
|
||||
|
||||
char *chsrc_type = xy_streql (option, ChsrcTypeReset) ? ChsrcTypeReset : ChsrcTypeAuto;
|
||||
char *chsrc_type = xy_streql (option, SetsrcType_Reset) ? SetsrcType_Reset : SetsrcType_Auto;
|
||||
|
||||
bool pdm_exist = false,
|
||||
poetry_exist = false;
|
||||
|
@ -77,7 +77,7 @@ pl_python_setsrc (char *option)
|
|||
void
|
||||
pl_python_resetsrc (char *option)
|
||||
{
|
||||
pl_python_setsrc (ChsrcTypeReset);
|
||||
pl_python_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ pl_python_pip_setsrc (char *option)
|
|||
}
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_the_source (pl_python);
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
||||
|
@ -53,7 +53,7 @@ pl_python_pip_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,7 +63,7 @@ pl_python_pip_setsrc (char *option)
|
|||
void
|
||||
pl_python_pip_resetsrc (char *option)
|
||||
{
|
||||
pl_python_pip_setsrc (ChsrcTypeReset);
|
||||
pl_python_pip_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ pl_r_setsrc (char *option)
|
|||
chsrc_append_to_file (towrite1, "~/.Rprofile");
|
||||
chsrc_append_to_file (towrite2, "~/.Rprofile");
|
||||
}
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target(pl_r);
|
||||
|
|
|
@ -60,7 +60,7 @@ pl_ruby_remove_gem_source (const char *source)
|
|||
void
|
||||
pl_ruby_setsrc (char *option)
|
||||
{
|
||||
char *chsrc_type = xy_streql (option, ChsrcTypeReset) ? ChsrcTypeReset : ChsrcTypeAuto;
|
||||
char *chsrc_type = xy_streql (option, SetsrcType_Reset) ? SetsrcType_Reset : SetsrcType_Auto;
|
||||
|
||||
chsrc_ensure_program ("gem");
|
||||
|
||||
|
@ -91,7 +91,7 @@ pl_ruby_setsrc (char *option)
|
|||
void
|
||||
pl_ruby_resetsrc (char *option)
|
||||
{
|
||||
pl_ruby_setsrc (ChsrcTypeReset);
|
||||
pl_ruby_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ pl_rust_setsrc (char *option)
|
|||
|
||||
chsrc_note2 (xy_strjoin (3, "请您手动写入以下内容到 ", xy_uniform_path ("~/.cargo/config.toml"), " 文件中:"));
|
||||
puts (file);
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target(pl_rust);
|
||||
|
|
|
@ -54,7 +54,7 @@ os_armbian_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ os_debian_setsrc_for_deb822 (char *option)
|
|||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,7 +103,7 @@ os_debian_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target(os_debian);
|
||||
|
|
|
@ -52,7 +52,7 @@ os_kali_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_kali);
|
||||
|
|
|
@ -39,7 +39,7 @@ 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, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target(os_linuxlite);
|
||||
|
|
|
@ -44,7 +44,7 @@ os_linuxmint_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
chsrc_warn2 ("完成后请不要再使用 mintsources(自带的图形化软件源设置工具)进行任何操作,因为在操作后,无论是否有按“确定”,mintsources 均会覆写我们刚才换源的内容");
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ os_ros_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target_s(os_ros);
|
||||
|
|
|
@ -44,7 +44,7 @@ os_raspberrypi_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_raspberrypi);
|
||||
|
|
|
@ -45,7 +45,7 @@ os_trisquel_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_trisquel);
|
||||
|
|
|
@ -71,7 +71,7 @@ os_ubuntu_setsrc_for_deb822 (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +112,7 @@ os_ubuntu_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target(os_ubuntu);
|
||||
|
|
|
@ -51,7 +51,7 @@ os_deepin_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_deepin);
|
||||
|
|
|
@ -39,7 +39,7 @@ 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, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_openkylin);
|
||||
|
|
|
@ -48,7 +48,7 @@ os_alpine_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_run ("apk update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_alpine);
|
||||
|
|
|
@ -128,7 +128,7 @@ os_freebsd_setsrc (char *option)
|
|||
chsrc_overwrite_file (update, "/etc/freebsd-update.conf");
|
||||
*/
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeSemiAuto);
|
||||
chsrc_conclude (&source, SetsrcType_SemiAuto);
|
||||
}
|
||||
|
||||
def_target_s(os_freebsd);
|
||||
|
|
|
@ -58,7 +58,7 @@ 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, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_netbsd);
|
||||
|
|
|
@ -47,7 +47,7 @@ os_openbsd_setsrc (char *option)
|
|||
chsrc_backup ("/etc/installurl");
|
||||
chsrc_overwrite_file (source.url, "/etc/installurl");
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_openbsd);
|
||||
|
|
|
@ -45,7 +45,7 @@ os_gentoo_setsrc (char *option)
|
|||
char *towrite = xy_strjoin (3, "GENTOO_MIRRORS=\"https://", source.url, "gentoo\"");
|
||||
|
||||
chsrc_append_to_file (towrite, "/etc/portage/make.conf");
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target_s(os_gentoo);
|
||||
|
|
|
@ -50,7 +50,7 @@ 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, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ os_solus_setsrc (char *option)
|
|||
|
||||
char *cmd = xy_2strjoin ("eopkg add-repo Solus ", source.url);
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target_s(os_solus);
|
||||
|
|
|
@ -52,7 +52,7 @@ os_void_setsrc (char *option)
|
|||
|
||||
chsrc_note2 ("若报错可尝试使用以下命令:");
|
||||
say (cmd);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(os_void);
|
||||
|
|
|
@ -36,7 +36,7 @@ os_almalinux_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target_s(os_almalinux);
|
||||
|
|
|
@ -36,7 +36,7 @@ os_anolis_setsrc (char *option)
|
|||
|
||||
chsrc_run ("dnf makecache", RunOpt_Default);
|
||||
chsrc_run ("dnf update", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target_s(os_anolis);
|
||||
|
|
|
@ -60,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_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target_s(os_fedora);
|
||||
|
|
|
@ -67,7 +67,7 @@ os_rockylinux_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("dnf makecache", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,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_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target_s(os_openeuler);
|
||||
|
|
|
@ -75,7 +75,7 @@ os_opensuse_setsrc (char *option)
|
|||
|
||||
chsrc_run (cmd5, RunOpt_Default);
|
||||
chsrc_run (cmd6, RunOpt_Default);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target_s(os_opensuse);
|
||||
|
|
|
@ -91,7 +91,7 @@ os_arch_setsrc (char *option)
|
|||
{
|
||||
chsrc_run ("pacman -Syy", RunOpt_No_Last_New_Line);
|
||||
}
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ 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, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
#undef OS_Pacman_MirrorList
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ os_msys2_setsrc (char *option)
|
|||
"#g\" /etc/pacman.d/mirrorlist* ");
|
||||
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target_s(os_msys2);
|
||||
|
|
|
@ -20,7 +20,7 @@ os_manjaro_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_run ("pacman -Syy", RunOpt_No_Last_New_Line);
|
||||
chsrc_conclude (NULL, ChsrcTypeAuto);
|
||||
chsrc_conclude (NULL, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
TargetInfo os_manjaro_target = {NULL, os_manjaro_setsrc, NULL, NULL, 0};
|
||||
|
|
|
@ -94,7 +94,7 @@ void
|
|||
<category>_<target>_resetsrc (char *option)
|
||||
{
|
||||
// 往往通过下述方式统一在 setsrc() 中实现
|
||||
// <category>_<target>_setsrc (ChsrcTypeReset);
|
||||
// <category>_<target>_setsrc (SetsrcType_Reset);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ wr_anaconda_setsrc (char *option)
|
|||
puts (file);
|
||||
|
||||
chsrc_note2 ("然后运行 conda clean -i 清除索引缓存,保证用的是镜像站提供的索引");
|
||||
chsrc_conclude (&source, ChsrcTypeSemiAuto);
|
||||
chsrc_conclude (&source, SetsrcType_SemiAuto);
|
||||
}
|
||||
|
||||
def_target_s (wr_anaconda);
|
||||
|
|
|
@ -38,7 +38,7 @@ wr_cocoapods_setsrc (char *option)
|
|||
char *source_str = xy_strjoin (3, "source '", source.url, "'");
|
||||
say (source_str);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target_s (wr_cocoapods);
|
||||
|
|
|
@ -91,7 +91,7 @@ wr_dockerhub_setsrc (char *option)
|
|||
chsrc_note2 ("选择“Docker Engine”选项卡,在该选项卡中找到“registry-mirrors”一栏,添加镜像地址:");
|
||||
puts (source.url);
|
||||
}
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ wr_emacs_setsrc (char *option)
|
|||
chsrc_note2 ("Emacs换源涉及Elisp,需要手动查阅并换源:");
|
||||
puts (source.url);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target_s (wr_emacs);
|
||||
|
|
|
@ -37,7 +37,7 @@ wr_flathub_setsrc (char *option)
|
|||
char *cmd = xy_2strjoin ("flatpak remote-modify flathub --url=", source.url);
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
def_target_s (wr_flathub);
|
||||
|
|
|
@ -33,7 +33,7 @@ wr_guix_setsrc (char *option)
|
|||
|
||||
chsrc_note2 ("为防止扰乱配置文件,请您手动写入以下内容到 ~/.config/guix/channels.scm 文件中");
|
||||
puts (file);
|
||||
chsrc_conclude (&source, ChsrcTypeManual);
|
||||
chsrc_conclude (&source, SetsrcType_Manual);
|
||||
}
|
||||
|
||||
def_target_s (wr_guix);
|
||||
|
|
|
@ -89,7 +89,7 @@ wr_homebrew_setsrc (char *option)
|
|||
chsrc_append_to_file (core_git_remote_fish, fishrc);
|
||||
}
|
||||
|
||||
chsrc_conclude(&source, ChsrcTypeAuto);
|
||||
chsrc_conclude(&source, SetsrcType_Auto);
|
||||
chsrc_note2 ("请您重启终端使Homebrew环境变量生效");
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ wr_nix_setsrc (char *option)
|
|||
chsrc_note2 ("若您使用的是NixOS,请额外添加下述内容至 configuration.nix 中");
|
||||
puts (cmd);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeSemiAuto);
|
||||
chsrc_conclude (&source, SetsrcType_SemiAuto);
|
||||
}
|
||||
|
||||
def_target_s (wr_nix);
|
||||
|
|
|
@ -78,7 +78,7 @@ wr_tex_setsrc (char *option)
|
|||
chsrc_run (cmd, RunOpt_Default);
|
||||
}
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeUntested);
|
||||
chsrc_conclude (&source, SetsrcType_Untested);
|
||||
}
|
||||
|
||||
def_target(wr_tex);
|
||||
|
|
|
@ -34,14 +34,14 @@ wr_winget_setsrc (char *option)
|
|||
chsrc_run ("winget source remove winget", RunOpt_Default);
|
||||
chsrc_run (xy_2strjoin ("winget source add winget ", source.url), RunOpt_Default);
|
||||
|
||||
chsrc_conclude (&source, ChsrcTypeAuto);
|
||||
chsrc_conclude (&source, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
void
|
||||
wr_winget_resetsrc (char *option)
|
||||
{
|
||||
chsrc_run ("winget source reset winget", RunOpt_Default);
|
||||
chsrc_conclude (NULL, ChsrcTypeAuto);
|
||||
chsrc_conclude (NULL, SetsrcType_Auto);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user