mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-24 03:19:27 +08:00
Split linuxlite out
This commit is contained in:
@@ -39,7 +39,6 @@ static const char
|
||||
};
|
||||
|
||||
|
||||
def_target(os_linuxlite);
|
||||
def_target(os_openkylin);
|
||||
def_target_noget(os_openeuler);
|
||||
def_target_noget(os_anolis);
|
||||
|
||||
47
src/recipe/os/apt-family/Linux-Lite.c
Normal file
47
src/recipe/os/apt-family/Linux-Lite.c
Normal file
@@ -0,0 +1,47 @@
|
||||
/** ------------------------------------------------------------
|
||||
* 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_linuxlite_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/linuxliteos/"}
|
||||
};
|
||||
def_sources_n(os_linuxlite);
|
||||
|
||||
|
||||
void
|
||||
os_linuxlite_getsrc (char *option)
|
||||
{
|
||||
chsrc_view_file (OS_Apt_SourceList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考: https://help.mirrors.cernet.edu.cn/linuxliteos/
|
||||
*/
|
||||
void
|
||||
os_linuxlite_setsrc (char *option)
|
||||
{
|
||||
chsrc_ensure_root ();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_linuxlite);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
chsrc_backup (OS_Apt_SourceList);
|
||||
|
||||
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/.*/?@", source.url, "@g' " OS_Apt_SourceList);
|
||||
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_say_lastly (&source, ChsrcTypeAuto);
|
||||
}
|
||||
|
||||
def_target(os_linuxlite);
|
||||
Reference in New Issue
Block a user