mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-01-23 02:11:01 +08:00
Split trisquel out
This commit is contained in:
parent
fa96a44bab
commit
8fc2fb050b
|
@ -371,17 +371,6 @@ os_linuxlite_sources[] = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @time 2023-09-29 更新
|
|
||||||
*/
|
|
||||||
os_trisquel_sources[] = {
|
|
||||||
{&Upstream, NULL},
|
|
||||||
{&Ali, "https://mirrors.aliyun.com/trisquel/"},
|
|
||||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/trisquel/"},
|
|
||||||
{&Nju, "https://mirror.nju.edu.cn/trisquel/"},
|
|
||||||
{&Ustc, "https://mirrors.ustc.edu.cn/trisquel/"}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @time 2023-09-29 更新
|
* @time 2023-09-29 更新
|
||||||
|
@ -631,7 +620,7 @@ def_sources_n(os_arch); def_sources_n(os_archlinuxcn);
|
||||||
def_sources_n(os_msys2); def_sources_n(os_gentoo);
|
def_sources_n(os_msys2); def_sources_n(os_gentoo);
|
||||||
def_sources_n(os_rocky); def_sources_n(os_alma);
|
def_sources_n(os_rocky); def_sources_n(os_alma);
|
||||||
|
|
||||||
def_sources_n(os_trisquel); def_sources_n(os_linuxlite); def_sources_n(os_raspberrypi);
|
def_sources_n(os_linuxlite); def_sources_n(os_raspberrypi);
|
||||||
def_sources_n(os_armbian);
|
def_sources_n(os_armbian);
|
||||||
|
|
||||||
def_sources_n(os_freebsd); def_sources_n(os_netbsd); def_sources_n(os_openbsd);
|
def_sources_n(os_freebsd); def_sources_n(os_netbsd); def_sources_n(os_openbsd);
|
||||||
|
|
30
src/chsrc.c
30
src/chsrc.c
|
@ -814,35 +814,7 @@ os_manjaro_setsrc (char *option)
|
||||||
chsrc_say_lastly (NULL, ChsrcTypeAuto);
|
chsrc_say_lastly (NULL, ChsrcTypeAuto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "recipe/os/trisquel.c"
|
||||||
|
|
||||||
void
|
|
||||||
os_trisquel_getsrc (char *option)
|
|
||||||
{
|
|
||||||
chsrc_view_file (ETC_APT_SOURCELIST);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参考: https://help.mirrors.cernet.edu.cn/trisquel/
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
os_trisquel_setsrc (char *option)
|
|
||||||
{
|
|
||||||
chsrc_ensure_root ();
|
|
||||||
|
|
||||||
SourceInfo source;
|
|
||||||
chsrc_yield_source (os_trisquel);
|
|
||||||
chsrc_confirm_source (&source);
|
|
||||||
|
|
||||||
chsrc_backup (ETC_APT_SOURCELIST);
|
|
||||||
|
|
||||||
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/trisquel/?@", source.url, "@g' /etc/apt/sources.list");
|
|
||||||
|
|
||||||
chsrc_run (cmd, RunOpt_Default);
|
|
||||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
|
||||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -40,7 +40,7 @@ static const char
|
||||||
|
|
||||||
|
|
||||||
def_target(os_ubuntu); def_target(os_mint); def_target(os_debian); def_target(os_kali);
|
def_target(os_ubuntu); def_target(os_mint); def_target(os_debian); def_target(os_kali);
|
||||||
def_target(os_trisquel); def_target(os_linuxlite);
|
def_target(os_linuxlite);
|
||||||
def_target(os_netbsd); def_target(os_openbsd);
|
def_target(os_netbsd); def_target(os_openbsd);
|
||||||
def_target(os_deepin); def_target(os_openkylin);
|
def_target(os_deepin); def_target(os_openkylin);
|
||||||
def_target(os_raspberrypi);
|
def_target(os_raspberrypi);
|
||||||
|
|
51
src/recipe/os/trisquel.c
Normal file
51
src/recipe/os/trisquel.c
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
/** ------------------------------------------------------------
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
* -------------------------------------------------------------
|
||||||
|
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
|
* Contributors : Nil Null <nil@null.org>
|
||||||
|
* Created On : <2023-09-29>
|
||||||
|
* Last Modified : <2024-08-16>
|
||||||
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @time 2023-09-29 更新
|
||||||
|
*/
|
||||||
|
static SourceInfo
|
||||||
|
os_trisquel_sources[] = {
|
||||||
|
{&Upstream, NULL},
|
||||||
|
{&Ali, "https://mirrors.aliyun.com/trisquel/"},
|
||||||
|
{&MirrorZ, "https://mirrors.cernet.edu.cn/trisquel/"},
|
||||||
|
{&Nju, "https://mirror.nju.edu.cn/trisquel/"},
|
||||||
|
{&Ustc, "https://mirrors.ustc.edu.cn/trisquel/"}
|
||||||
|
};
|
||||||
|
def_sources_n(os_trisquel);
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
os_trisquel_getsrc (char *option)
|
||||||
|
{
|
||||||
|
chsrc_view_file (ETC_APT_SOURCELIST);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参考: https://help.mirrors.cernet.edu.cn/trisquel/
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
os_trisquel_setsrc (char *option)
|
||||||
|
{
|
||||||
|
chsrc_ensure_root ();
|
||||||
|
|
||||||
|
SourceInfo source;
|
||||||
|
chsrc_yield_source (os_trisquel);
|
||||||
|
chsrc_confirm_source (&source);
|
||||||
|
|
||||||
|
chsrc_backup (ETC_APT_SOURCELIST);
|
||||||
|
|
||||||
|
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/trisquel/?@", source.url, "@g' /etc/apt/sources.list");
|
||||||
|
|
||||||
|
chsrc_run (cmd, RunOpt_Default);
|
||||||
|
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||||
|
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||||
|
}
|
||||||
|
|
||||||
|
def_target(os_trisquel);
|
Loading…
Reference in New Issue
Block a user