Split trisquel out

This commit is contained in:
Aoran Zeng 2024-08-16 00:59:32 +08:00
parent fa96a44bab
commit 8fc2fb050b
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
4 changed files with 54 additions and 42 deletions

View File

@ -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);

View File

@ -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

View File

@ -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
View 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);