mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-07 02:34:08 +08:00
Prerelease v0.2.1.1
This commit is contained in:
parent
61a049b776
commit
e8c0085c47
@ -27,13 +27,13 @@
|
||||
* | MadDogOwner <xiaoran@xrgzs.top>
|
||||
* |
|
||||
* Created On : <2023-08-28>
|
||||
* Last Modified : <2025-04-15>
|
||||
* Last Modified : <2025-05-27>
|
||||
*
|
||||
* chsrc: Change Source —— 全平台通用命令行换源工具
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
#define Chsrc_Version "0.2.1"
|
||||
#define Chsrc_Release_Date "2025/04/13"
|
||||
#define Chsrc_Version "0.2.1.1"
|
||||
#define Chsrc_Release_Date "2025/05/27"
|
||||
#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
|
||||
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"
|
||||
|
||||
|
@ -83,7 +83,7 @@ os_arch_setsrc (char *option)
|
||||
to_write = xy_strjoin (3, "Server = ", source.url, "arm/$arch/$repo");
|
||||
}
|
||||
|
||||
// 越前面的优先级越高
|
||||
/* 配置文件中,越前面的优先级越高 */
|
||||
chsrc_prepend_to_file (to_write, OS_Pacman_MirrorList);
|
||||
|
||||
if (is_x86)
|
||||
@ -120,19 +120,22 @@ os_archlinuxcn_setsrc (char *option)
|
||||
chsrc_backup (OS_Pacman_ArchLinuxCN_MirrorList);
|
||||
|
||||
char *arch = chsrc_get_cpuarch ();
|
||||
|
||||
// 检查是否已存在 archlinuxcn 配置段
|
||||
|
||||
/* 检查是否已存在 archlinuxcn 配置段 */
|
||||
char *check_cmd = "grep -q '\\[archlinuxcn\\]' " OS_Pacman_ArchLinuxCN_MirrorList;
|
||||
int ret = system(check_cmd);
|
||||
|
||||
if (ret == 0) {
|
||||
char *sed_cmd = xy_strjoin (4, "sed -i '/\\[archlinuxcn\\]/{n;s|^Server = .*|Server = ",
|
||||
source.url, "$arch|;}' ", OS_Pacman_ArchLinuxCN_MirrorList);
|
||||
chsrc_run (sed_cmd, RunOpt_Default);
|
||||
} else {
|
||||
char *archlinuxcn_config = xy_strjoin (3, "\n[archlinuxcn]\nServer = ", source.url, "$arch\n");
|
||||
chsrc_append_to_file (archlinuxcn_config, OS_Pacman_ArchLinuxCN_MirrorList);
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
char *sed_cmd = xy_strjoin (4, "sed -i '/\\[archlinuxcn\\]/{n;s|^Server = .*|Server = ",
|
||||
source.url, "$arch|;}' ", OS_Pacman_ArchLinuxCN_MirrorList);
|
||||
chsrc_run (sed_cmd, RunOpt_Default);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *archlinuxcn_config = xy_strjoin (3, "\n[archlinuxcn]\nServer = ", source.url, "$arch\n");
|
||||
chsrc_append_to_file (archlinuxcn_config, OS_Pacman_ArchLinuxCN_MirrorList);
|
||||
}
|
||||
|
||||
chsrc_run ("pacman-key --lsign-key \"farseerfc@archlinux.org\"", RunOpt_Dont_Abort_On_Failure); // 此命令可能会失败, 但对换源没有影响
|
||||
chsrc_run ("pacman -Sy archlinuxcn-keyring", RunOpt_Default);
|
||||
|
@ -4,6 +4,7 @@
|
||||
* File Name : recipe-template.c
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Contributors : Nil Null <nil@null.org>
|
||||
* |
|
||||
* Created On : <2024-08-09>
|
||||
* Last Modified : <2024-11-22>
|
||||
* -------------------------------------------------------------
|
||||
@ -13,21 +14,28 @@
|
||||
*
|
||||
* 模版中:
|
||||
* <target> 为该换源目标的名称
|
||||
* <category> 为该换源目标的类别,仅有3类: pl, os, wr
|
||||
* <category> 为该换源目标的类别,仅有3类: pl, os, wr
|
||||
* 分别对应3个子目录: lang, os, ware
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
/* 模版文件从下行正式开始 */
|
||||
|
||||
/* 模版文件内容从下方第30行正式开始 */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Name : <target>.c
|
||||
* File Authors : Nil Null <nil@null.org> 尼尔闹先生
|
||||
* Contributors : Nul None <nul@none.org> 怒了馕女士
|
||||
* Created On : <2024-01-01> https://www.yuque.com/ccmywish/blog/nil-null-and-nul-none
|
||||
* Last Modified : <2024-01-01> 请更新文件标头
|
||||
* |
|
||||
* Created On : <2025-01-01> https://www.yuque.com/ccmywish/blog/nil-null-and-nul-none
|
||||
* Last Modified : <2025-01-01> 请更新文件标头
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@ -42,7 +50,7 @@ RubyMetric = {"rbmt", // chsrc set <target> rbmt
|
||||
"https://rubymetirc.com/target/aws/aws-sdk-go/@v/v1.45.2.zip"};
|
||||
|
||||
/**
|
||||
* @update 2024-08-09
|
||||
* @update 2025-12-31
|
||||
* @note 该target的各个源地址,该例数据为虚拟填充
|
||||
*/
|
||||
static Source_t
|
||||
|
Loading…
x
Reference in New Issue
Block a user