mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-09 20:34:08 +08:00
Split linuxlite out
This commit is contained in:
parent
d3c8f7fdfe
commit
1c37cfa311
@ -173,16 +173,6 @@ os_msys2_sources[] = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @time 2023-09-29 更新
|
|
||||||
*/
|
|
||||||
os_linuxlite_sources[] = {
|
|
||||||
{&Upstream, NULL},
|
|
||||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/linuxliteos/"}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @time 2023-09-06 更新
|
* @time 2023-09-06 更新
|
||||||
@ -333,8 +323,6 @@ def_sources_n(pl_dotnet);
|
|||||||
|
|
||||||
def_sources_n(os_msys2);
|
def_sources_n(os_msys2);
|
||||||
|
|
||||||
def_sources_n(os_linuxlite);
|
|
||||||
|
|
||||||
def_sources_n(os_openeuler); def_sources_n(os_openkylin);
|
def_sources_n(os_openeuler); def_sources_n(os_openkylin);
|
||||||
def_sources_n(os_anolis);
|
def_sources_n(os_anolis);
|
||||||
|
|
||||||
|
29
src/chsrc.c
29
src/chsrc.c
@ -82,6 +82,7 @@ pl_clojure_setsrc (char *option)
|
|||||||
// Ubuntu-based
|
// Ubuntu-based
|
||||||
#include "recipe/os/apt-family/linuxmint.c"
|
#include "recipe/os/apt-family/linuxmint.c"
|
||||||
#include "recipe/os/apt-family/trisquel.c"
|
#include "recipe/os/apt-family/trisquel.c"
|
||||||
|
#include "recipe/os/apt-family/Linux-Lite.c"
|
||||||
// Independent
|
// Independent
|
||||||
#include "recipe/os/apt-family/ros.c"
|
#include "recipe/os/apt-family/ros.c"
|
||||||
#include "recipe/os/apt-family/deepin.c"
|
#include "recipe/os/apt-family/deepin.c"
|
||||||
@ -150,34 +151,6 @@ os_manjaro_setsrc (char *option)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
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' /etc/apt/sources.list");
|
|
||||||
|
|
||||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
|
||||||
chsrc_say_lastly (&source, ChsrcTypeAuto);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "recipe/os/openwrt.c"
|
#include "recipe/os/openwrt.c"
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ static const char
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
def_target(os_linuxlite);
|
|
||||||
def_target(os_openkylin);
|
def_target(os_openkylin);
|
||||||
def_target_noget(os_openeuler);
|
def_target_noget(os_openeuler);
|
||||||
def_target_noget(os_anolis);
|
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);
|
Loading…
x
Reference in New Issue
Block a user