mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-29 04:09:32 +08:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
26e3c60ae8 | ||
|
53225997d2 | ||
|
bfb6022beb | ||
|
53adda7268 |
@ -31,12 +31,12 @@
|
|||||||
* | Rui Yang <techoc@foxmail.com>
|
* | Rui Yang <techoc@foxmail.com>
|
||||||
* |
|
* |
|
||||||
* Created On : <2023-08-28>
|
* Created On : <2023-08-28>
|
||||||
* Last Modified : <2025-07-26>
|
* Last Modified : <2025-07-28>
|
||||||
*
|
*
|
||||||
* chsrc: Change Source —— 全平台通用命令行换源工具
|
* chsrc: Change Source —— 全平台通用命令行换源工具
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
#define Chsrc_Version "0.2.2"
|
#define Chsrc_Version "0.2.2.1-dev1"
|
||||||
#define Chsrc_Release_Date "2025/07/26"
|
#define Chsrc_Release_Date "2025/07/26"
|
||||||
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
|
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
|
||||||
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"
|
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* | Yangmoooo <yangmoooo@outlook.com>
|
* | Yangmoooo <yangmoooo@outlook.com>
|
||||||
* |
|
* |
|
||||||
* Created On : <2023-08-29>
|
* Created On : <2023-08-29>
|
||||||
* Last Modified : <2025-07-22>
|
* Last Modified : <2025-07-28>
|
||||||
*
|
*
|
||||||
* chsrc framework
|
* chsrc framework
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
@ -1347,7 +1347,7 @@ chsrc_make_tmpfile (char *filename, char *postfix, bool loud, char **tmpfilename
|
|||||||
char *tmpfile = xy_strjoin (3, "chsrc_tmp_", filename, postfix);
|
char *tmpfile = xy_strjoin (3, "chsrc_tmp_", filename, postfix);
|
||||||
FILE *f = fopen (tmpfile, "w+");
|
FILE *f = fopen (tmpfile, "w+");
|
||||||
#else
|
#else
|
||||||
char *tmpfile = xy_strjoin (4, "/tmp/", "chsrc_tmp_", filename, "_XXXXXX", postfix);
|
char *tmpfile = xy_strjoin (5, "/tmp/", "chsrc_tmp_", filename, "_XXXXXX", postfix);
|
||||||
size_t postfix_len = strlen (postfix);
|
size_t postfix_len = strlen (postfix);
|
||||||
|
|
||||||
/* 和 _mktemp_s() 参数不同,前者是整个缓存区大小,这里的长度是后缀长度 */
|
/* 和 _mktemp_s() 参数不同,前者是整个缓存区大小,这里的长度是后缀长度 */
|
||||||
@ -1402,7 +1402,7 @@ chsrc_run_as_bash_file (const char *script_content)
|
|||||||
// chmod (tmpfile, 0700);
|
// chmod (tmpfile, 0700);
|
||||||
char *msg = CHINESE ? "即将执行 Bash 脚本内容:" : "The Bash script content will be executed:";
|
char *msg = CHINESE ? "即将执行 Bash 脚本内容:" : "The Bash script content will be executed:";
|
||||||
chsrc_note2 (msg);
|
chsrc_note2 (msg);
|
||||||
print (faint(script_content));
|
println (faint(script_content));
|
||||||
char *cmd = xy_2strjoin ("bash ", tmpfile);
|
char *cmd = xy_2strjoin ("bash ", tmpfile);
|
||||||
chsrc_run (cmd, RunOpt_Dont_Abort_On_Failure);
|
chsrc_run (cmd, RunOpt_Dont_Abort_On_Failure);
|
||||||
remove (tmpfile);
|
remove (tmpfile);
|
||||||
@ -1422,7 +1422,7 @@ chsrc_run_as_sh_file (const char *script_content)
|
|||||||
// chmod (tmpfile, 0700);
|
// chmod (tmpfile, 0700);
|
||||||
char *msg = CHINESE ? "即将执行 sh 脚本内容:" : "The sh script content will be executed:";
|
char *msg = CHINESE ? "即将执行 sh 脚本内容:" : "The sh script content will be executed:";
|
||||||
chsrc_note2 (msg);
|
chsrc_note2 (msg);
|
||||||
print (faint(script_content));
|
println (faint(script_content));
|
||||||
char *cmd = xy_2strjoin ("sh ", tmpfile);
|
char *cmd = xy_2strjoin ("sh ", tmpfile);
|
||||||
chsrc_run (cmd, RunOpt_Dont_Abort_On_Failure);
|
chsrc_run (cmd, RunOpt_Dont_Abort_On_Failure);
|
||||||
remove (tmpfile);
|
remove (tmpfile);
|
||||||
@ -1441,7 +1441,7 @@ chsrc_run_as_pwsh_file (const char *script_content)
|
|||||||
fclose (f);
|
fclose (f);
|
||||||
char *msg = CHINESE ? "即将执行 PowerShell 脚本内容:" : "The PowerShell script content will be executed:";
|
char *msg = CHINESE ? "即将执行 PowerShell 脚本内容:" : "The PowerShell script content will be executed:";
|
||||||
chsrc_note2 (msg);
|
chsrc_note2 (msg);
|
||||||
print (faint(script_content));
|
println (faint(script_content));
|
||||||
char *cmd = xy_2strjoin ("pwsh ", tmpfile);
|
char *cmd = xy_2strjoin ("pwsh ", tmpfile);
|
||||||
chsrc_run (cmd, RunOpt_Dont_Abort_On_Failure);
|
chsrc_run (cmd, RunOpt_Dont_Abort_On_Failure);
|
||||||
remove (tmpfile);
|
remove (tmpfile);
|
||||||
|
@ -2,27 +2,41 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* -------------------------------------------------------------
|
* -------------------------------------------------------------
|
||||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
* Contributors : Nil Null <nil@null.org>
|
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
|
||||||
* Created On : <2023-09-10>
|
* Created On : <2023-09-10>
|
||||||
* Last Modified : <2025-07-13>
|
* Last Modified : <2025-07-28>
|
||||||
*
|
*
|
||||||
* MiKTeX 和 TeX Live 都是流行的 LaTeX 发行版,但它们是不同的实现
|
* MiKTeX 和 TeX Live 都是流行的 LaTeX 发行版,但它们是不同的实现
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @update 2025-07-13
|
* @update 2025-07-28
|
||||||
*/
|
*/
|
||||||
static Source_t wr_tex_sources[] =
|
static Source_t wr_tex_sources[] =
|
||||||
{
|
{
|
||||||
{&UpstreamProvider, NULL, NULL},
|
{&UpstreamProvider, NULL, NULL},
|
||||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet", NULL},
|
{&MirrorZ, "https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet", NULL},
|
||||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/ctan/systems/texlive/tlnet", NULL},
|
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet", NULL},
|
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/ctan/systems/texlive/tlnet",
|
||||||
{&Bfsu, "https://mirrors.bfsu.edu.cn/CTAN/systems/texlive/tlnet", NULL},
|
"https://mirrors.sustech.edu.cn/CTAN/systems/texlive/tlnet/archive/fandol.tar.xz"},
|
||||||
{&Bjtu, "https://mirror.bjtu.edu.cn/ctan/systems/texlive/tlnet", NULL},
|
|
||||||
{&Lzuoss, "https://mirror.lzu.edu.cn/CTAN/systems/texlive/tlnet", NULL},
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet",
|
||||||
{&Jlu, "https://mirrors.jlu.edu.cn/CTAN/systems/texlive/tlnet", NULL},
|
"https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/archive/fandol.tar.xz"},
|
||||||
{&Sustech, "https://mirrors.sustech.edu.cn/CTAN/systems/texlive/tlnet", NULL}
|
|
||||||
|
{&Bfsu, "https://mirrors.bfsu.edu.cn/CTAN/systems/texlive/tlnet",
|
||||||
|
"https://mirrors.bfsu.edu.cn/CTAN/systems/texlive/tlnet/archive/fandol.tar.xz"},
|
||||||
|
|
||||||
|
{&Bjtu, "https://mirror.bjtu.edu.cn/ctan/systems/texlive/tlnet",
|
||||||
|
"https://mirror.bjtu.edu.cn/ctan/systems/texlive/tlnet/archive/fandol.tar.xz"},
|
||||||
|
|
||||||
|
{&Lzuoss, "https://mirror.lzu.edu.cn/CTAN/systems/texlive/tlnet",
|
||||||
|
"https://mirror.lzu.edu.cn/CTAN/systems/texlive/tlnet/archive/fandol.tar.xz"},
|
||||||
|
|
||||||
|
{&Jlu, "https://mirrors.jlu.edu.cn/CTAN/systems/texlive/tlnet",
|
||||||
|
"https://mirrors.jlu.edu.cn/CTAN/systems/texlive/tlnet/archive/fandol.tar.xz"},
|
||||||
|
|
||||||
|
{&Sustech, "https://mirrors.sustech.edu.cn/CTAN/systems/texlive/tlnet",
|
||||||
|
"https://mirrors.sustech.edu.cn/CTAN/systems/texlive/tlnet/archive/fandol.tar.xz"}
|
||||||
};
|
};
|
||||||
def_sources_n(wr_tex);
|
def_sources_n(wr_tex);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user