mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-01-22 08:46:15 +08:00
Add support for Trisquel
Gitee close #I84XQQ
This commit is contained in:
parent
92c55ed6dc
commit
f674bd118c
37
chsrc.c
37
chsrc.c
|
@ -3,7 +3,7 @@
|
|||
* License : GPLv3
|
||||
* Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Created on : <2023-08-28>
|
||||
* Last modified : <2023-09-27>
|
||||
* Last modified : <2023-09-29>
|
||||
*
|
||||
* chsrc:
|
||||
*
|
||||
|
@ -12,7 +12,7 @@
|
|||
* 该软件为自由软件,采用 GPLv3 许可证,请查阅 LICENSE.txt 文件
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
#define Chsrc_Version "v0.1.2-20230927"
|
||||
#define Chsrc_Version "v0.1.2-20230929"
|
||||
|
||||
#include "chsrc.h"
|
||||
|
||||
|
@ -1211,6 +1211,36 @@ os_manjaro_setsrc(char* option)
|
|||
|
||||
|
||||
|
||||
void
|
||||
os_trisquel_getsrc (char* option)
|
||||
{
|
||||
chsrc_check_file ("/etc/apt/sources.list");
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考: https://help.mirrors.cernet.edu.cn/trisquel/
|
||||
*/
|
||||
void
|
||||
os_trisquel_setsrc (char* option)
|
||||
{
|
||||
ensure_root();
|
||||
|
||||
int index = use_specific_mirror_or_auto_select (option, os_trisquel);
|
||||
|
||||
source_info source = os_trisquel_sources[index];
|
||||
chsrc_say_selection(&source);
|
||||
|
||||
chsrc_backup ("/etc/apt/sources.list");
|
||||
|
||||
char* cmd = xy_strjoin(3, "sed -E -i 's@https?://.*/trisquel/?@", source.url, "@g' /etc/apt/sources.list");
|
||||
|
||||
puts(cmd);
|
||||
chsrc_run("sudo apt update");
|
||||
chsrc_say_thanks(&source);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* HELP: 未经测试
|
||||
*/
|
||||
|
@ -1759,6 +1789,7 @@ def_target_info(os_ubuntu);
|
|||
def_target_info(os_debian);
|
||||
def_target_info(os_deepin);
|
||||
def_target_info(os_void);
|
||||
def_target_info(os_trisquel);
|
||||
def_target_info(os_netbsd);
|
||||
def_target_info(os_openbsd);
|
||||
|
||||
|
@ -1790,6 +1821,7 @@ static const char
|
|||
*os_rocky [] = {"rocky", "rockylinux", NULL, targetinfo(&os_rocky_target)},
|
||||
*os_alpine [] = {"alpine", NULL, targetinfo(&os_alpine_target)},
|
||||
*os_void [] = {"void", "voidlinux", NULL, targetinfo(&os_void_target)},
|
||||
*os_trisquel [] = {"trisquel", NULL, targetinfo(&os_trisquel_target)},
|
||||
*os_freebsd [] = {"freebsd", NULL, targetinfo(&os_freebsd_target)},
|
||||
*os_netbsd [] = {"netbsd", NULL, targetinfo(&os_netbsd_target)},
|
||||
*os_openbsd [] = {"openbsd", NULL, targetinfo(&os_openbsd_target)},
|
||||
|
@ -1802,6 +1834,7 @@ static const char
|
|||
os_arch, os_manjaro, os_gentoo,
|
||||
os_rocky,
|
||||
os_alpine,
|
||||
os_trisquel,
|
||||
os_freebsd, os_netbsd, os_openbsd,
|
||||
os_msys2,
|
||||
os_deepin, os_openeuler, os_openkylin,
|
||||
|
|
Loading…
Reference in New Issue
Block a user