mirror of
https://github.com/RubyMetric/chsrc.git
synced 2024-11-25 09:41:46 +08:00
Split openkylin out
This commit is contained in:
parent
0a65baecb0
commit
415d5d2092
|
@ -213,9 +213,9 @@ sudo chsrc set raspi 或 set raspberrypi
|
|||
sudo chsrc set armbian
|
||||
sudo chsrc set openwrt
|
||||
|
||||
sudo chsrc set euler 或 set openeuler
|
||||
sudo chsrc set anolis 或 set openanolis
|
||||
sudo chsrc set kylin 或 set openkylin
|
||||
sudo chsrc set openeuler
|
||||
sudo chsrc set openanolis
|
||||
sudo chsrc set openkylin
|
||||
sudo chsrc set deepin
|
||||
|
||||
chsrc set msys2 或 set msys
|
||||
|
|
|
@ -181,20 +181,11 @@ os_anolis_sources[] = {
|
|||
{&Upstream, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/anolis"},
|
||||
{&Hust, "https://mirrors.hust.edu.cn/anolis"}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @time 2023-09-29 更新
|
||||
*/
|
||||
os_openkylin_sources[] = {
|
||||
{&Upstream, "https://archive.openkylin.top/openkylin/"},
|
||||
{&Ali, "https://mirrors.aliyun.com/openkylin/"},
|
||||
{&Netease, "https://mirrors.163.com/openkylin/"},
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @time 2024-06-07 更新
|
||||
* @note 目前仅有一个源
|
||||
|
@ -307,7 +298,6 @@ def_sources_n(pl_dotnet);
|
|||
|
||||
def_sources_n(os_msys2);
|
||||
|
||||
def_sources_n(os_openkylin);
|
||||
def_sources_n(os_anolis);
|
||||
|
||||
def_sources_n(wr_winget);
|
||||
|
|
25
src/chsrc.c
25
src/chsrc.c
|
@ -85,6 +85,7 @@ pl_clojure_setsrc (char *option)
|
|||
#include "recipe/os/apt-family/Linux-Lite.c"
|
||||
// Independent
|
||||
#include "recipe/os/apt-family/ros.c"
|
||||
#include "recipe/os/apt-family/openKylin.c"
|
||||
#include "recipe/os/apt-family/deepin.c"
|
||||
|
||||
|
||||
|
@ -178,30 +179,6 @@ os_anolis_setsrc (char *option)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
os_openkylin_getsrc (char *option)
|
||||
{
|
||||
chsrc_view_file (OS_Apt_SourceList);
|
||||
}
|
||||
|
||||
void
|
||||
os_openkylin_setsrc (char *option)
|
||||
{
|
||||
chsrc_ensure_root();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_openkylin);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
chsrc_backup (OS_Apt_SourceList);
|
||||
|
||||
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/openkylin/?@", source.url, "@g'" OS_Apt_SourceList);
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||
}
|
||||
|
||||
|
||||
#include "recipe/os/freebsd.c"
|
||||
#include "recipe/os/netbsd.c"
|
||||
#include "recipe/os/openbsd.c"
|
||||
|
|
|
@ -39,7 +39,6 @@ static const char
|
|||
};
|
||||
|
||||
|
||||
def_target(os_openkylin);
|
||||
def_target_noget(os_anolis);
|
||||
def_target_noget(os_msys2);
|
||||
TargetInfo os_manjaro_target = {NULL, os_manjaro_setsrc, NULL, NULL, 0};
|
||||
|
|
47
src/recipe/os/apt-family/openKylin.c
Normal file
47
src/recipe/os/apt-family/openKylin.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Authors : Heng Guo <2085471348@qq.com>
|
||||
* Contributors : Nil Null <nil@null.org>
|
||||
* Created On : <2023-09-06>
|
||||
* Last Modified : <2024-08-16>
|
||||
*
|
||||
* openKylin直接基于Linux内核开发,属于和Debian、openSUSE、Fedora、Arch
|
||||
* 同一级别的、根社区发布的系统
|
||||
* -------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @time 2023-09-29 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
os_openkylin_sources[] = {
|
||||
{&Upstream, "https://archive.openkylin.top/openkylin/"},
|
||||
{&Ali, "https://mirrors.aliyun.com/openkylin/"},
|
||||
{&Netease, "https://mirrors.163.com/openkylin/"},
|
||||
};
|
||||
def_sources_n(os_openkylin);
|
||||
|
||||
void
|
||||
os_openkylin_getsrc (char *option)
|
||||
{
|
||||
chsrc_view_file (OS_Apt_SourceList);
|
||||
}
|
||||
|
||||
void
|
||||
os_openkylin_setsrc (char *option)
|
||||
{
|
||||
chsrc_ensure_root();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_openkylin);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
chsrc_backup (OS_Apt_SourceList);
|
||||
|
||||
char *cmd = xy_strjoin (3, "sed -E -i 's@https?://.*/openkylin/?@", source.url, "@g'" OS_Apt_SourceList);
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
|
||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||
}
|
||||
|
||||
def_target(os_openkylin);
|
Loading…
Reference in New Issue
Block a user