Skip to content

Commit 92f3411

Browse files
committed
Use chsrc_alert2()
1 parent fa4a69b commit 92f3411

File tree

16 files changed

+29
-28
lines changed

16 files changed

+29
-28
lines changed

src/framework/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ chsrc_ensure_dir (const char *dir)
15751575
chsrc_run_as_a_service (cmd);
15761576

15771577
char *msg = ENGLISH ? "Directory doesn't exist, created automatically " : "目录不存在,已自动创建 ";
1578-
chsrc_note2 (xy_2strjoin (msg, dir));
1578+
chsrc_alert2 (xy_2strjoin (msg, dir));
15791579
}
15801580

15811581

@@ -1701,7 +1701,7 @@ chsrc_backup (const char *path)
17011701
if (!exist)
17021702
{
17031703
char *msg = ENGLISH ? "File doesn't exist, skip backup: " : "文件不存在,跳过备份: ";
1704-
chsrc_note2 (xy_2strjoin (msg, path));
1704+
chsrc_alert2 (xy_2strjoin (msg, path));
17051705
return;
17061706
}
17071707

src/recipe/lang/Node.js/Node.js.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pl_nodejs_group_setsrc (char *option)
6868
"npm, pnpm, yarn. If you need to change the source independently, "
6969
"please run independently `chsrc set <pkg-manager>`"
7070
: "将同时更换3个包管理器 npm, pnpm, Yarn 的源,若需要独立换源,请独立运行 chsrc set <pkg-manager>";
71-
chsrc_note2 (msg);
71+
chsrc_alert2 (msg);
7272
}
7373

7474
bool npm_exist, yarn_exist, pnpm_exist;

src/recipe/lang/OCaml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ pl_ocaml_setsrc (char *option)
4949

5050
chsrc_run (cmd, RunOpt_Default);
5151

52-
chsrc_note2 ("如果是首次使用 opam ,请使用以下命令进行初始化");
53-
p(xy_2strjoin ("opam init default ", source.url));
52+
chsrc_alert2 ("如果是首次使用 opam ,请使用以下命令进行初始化");
53+
println (xy_2strjoin ("opam init default ", source.url));
5454

5555
chsrc_determine_chgtype (ChgType_SemiAuto);
5656
chsrc_conclude (&source);

src/recipe/lang/Perl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pl_perl_setsrc (char *option)
6060
"perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('urllist', 'unshift', '", source.url, "'); CPAN::HandleConfig->commit()\"");
6161
chsrc_run (cmd, RunOpt_Default);
6262

63-
chsrc_note2 ("请使用 perl -v 以及 cpan -v,若 Perl >= v5.36 或 CPAN >= 2.29,请额外手动调用下面的命令");
63+
chsrc_alert2 ("请使用 perl -v 以及 cpan -v,若 Perl >= v5.36 或 CPAN >= 2.29,请额外手动调用下面的命令");
6464
p ("perl -MCPAN -e \"CPAN::HandleConfig->load(); CPAN::HandleConfig->edit('pushy_https', 0);; CPAN::HandleConfig->commit()\"");
6565

6666
chsrc_determine_chgtype (ChgType_SemiAuto);

src/recipe/lang/Python/Poetry.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
void
1616
pl_python_poetry_getsrc (char *option)
1717
{
18-
chsrc_note2 ("poetry换源情况: 请查阅本项目 pyproject.toml 中 [[tool.poetry.source]]");
18+
chsrc_note2 ("poetry换源情况: 请查看本项目 pyproject.toml 中 [[tool.poetry.source]]");
1919
}
2020

2121

@@ -34,7 +34,7 @@ pl_python_poetry_setsrc (char *option)
3434
char *cmd = NULL;
3535

3636
if (!chsrc_in_local_mode())
37-
chsrc_note2 ("Poertry 仅支持项目级换源");
37+
chsrc_alert2 ("Poetry 仅支持项目级换源");
3838

3939
cmd = xy_2strjoin ("poetry source add my_mirror ", source.url);
4040
chsrc_run (cmd, RunOpt_No_Last_New_Line);

src/recipe/lang/Python/Python.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pl_python_group_setsrc (char *option)
4848
"pip, Poetry, PDM. If you need to change the source independently, "
4949
"please run independently `chsrc set <pkg-manager>`"
5050
: "将同时更换4个包管理器 pip, Poetry, PDM, uv 的源,若需要独立换源,请独立运行 chsrc set <pkg-manager>";
51-
chsrc_note2 (msg);
51+
chsrc_alert2 (msg);
5252
}
5353

5454
bool pdm_exist = false,

src/recipe/lang/Rust/rustup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pl_rust_rustup_setsrc (char *option)
9696

9797
chsrc_determine_chgtype (ChgType_Auto);
9898
chsrc_conclude (&source);
99-
chsrc_note2 ("请重启终端使rustup环境变量生效");
99+
chsrc_alert2 ("请重启终端使rustup环境变量生效");
100100
}
101101

102102

src/recipe/os/APT/Debian.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ os_debian_setsrc (char *option)
140140
return;
141141
}
142142

143-
chsrc_note2 ("将基于旧格式(非DEB822)换源");
143+
chsrc_alert2 ("将基于旧格式(非DEB822)换源");
144144

145145
/* Docker环境下,Debian镜像可能不存在该文件 */
146146
bool sourcelist_exist = ensure_debian_or_ubuntu_old_sourcelist (OS_Is_Debian_Literally);
@@ -167,7 +167,7 @@ os_debian_setsrc (char *option)
167167

168168
chsrc_yield_source_and_confirm (os_debian);
169169

170-
chsrc_note2 ("如果遇到无法拉取 HTTPS 源的情况,请手动运行:");
170+
chsrc_alert2 ("如果遇到无法拉取 HTTPS 源的情况,请手动运行:");
171171
say ("apt install apt-transport-https ca-certificates");
172172

173173
/* 不存在的时候,用的是我们生成的用来填充占位的无效文件,不要备份 */

src/recipe/os/APT/Ubuntu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ os_ubuntu_setsrc (char *option)
131131
return;
132132
}
133133

134-
chsrc_note2 ("将基于旧格式(非DEB822)换源");
134+
chsrc_alert2 ("将基于旧格式(非DEB822)换源");
135135

136136
bool sourcelist_exist = ensure_debian_or_ubuntu_old_sourcelist (OS_Is_Ubuntu);
137137

src/recipe/os/BSD/FreeBSD.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ os_freebsd_setsrc (char *option)
6060
chsrc_note2 (
6161
xy_strjoin (3, "若要使用季度分支,请在", conf ,"中将latest改为quarterly"));
6262

63-
chsrc_note2 ("若要使用HTTPS源,请先安装securtiy/ca_root_ns,并将'http'改成'https',最后使用'pkg update -f'刷新缓存即可\n");
63+
chsrc_alert2 ("若要使用HTTPS源,请先安装securtiy/ca_root_ns,并将'http'改成'https',最后使用'pkg update -f'刷新缓存即可\n");
6464
br();
6565

6666
chsrc_log2 ("2. 修改 freebsd-ports 源");
@@ -77,7 +77,7 @@ os_freebsd_setsrc (char *option)
7777
char *git_cmd = xy_strjoin (3, "git clone --depth 1 https://", source.url, "/freebsd-ports/ports.git /usr/ports");
7878
chsrc_run (git_cmd, RunOpt_Default);
7979
source = os_freebsd_sources[index]; // 恢复至选中的源
80-
chsrc_note2 ("下次更新请使用 git -C /usr/ports pull 而非使用 gitup");
80+
chsrc_alert2 ("下次更新请使用 git -C /usr/ports pull 而非使用 gitup");
8181
}
8282
else
8383
{
@@ -114,7 +114,7 @@ os_freebsd_setsrc (char *option)
114114

115115

116116
// HELP: 暂时没有源提供
117-
chsrc_note2 ("4. 抱歉,目前境内无 freebsd-update 源,若存在请报告issue,谢谢");
117+
chsrc_alert2 ("4. 抱歉,目前境内无 freebsd-update 源,若存在请报告issue,谢谢");
118118
/*
119119
chsrc_log2 ("3. 修改 freebsd-update 源");
120120

0 commit comments

Comments
 (0)