mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-20 18:05:08 +08:00
Qualify os family name
This commit is contained in:
47
src/recipe/os/APT/openKylin.c
Normal file
47
src/recipe/os/APT/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);
|
Reference in New Issue
Block a user