mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-18 09:54:15 +08:00
Split anolis out
This commit is contained in:
23
src/chsrc.c
23
src/chsrc.c
@@ -98,6 +98,7 @@ pl_clojure_setsrc (char *option)
|
||||
#include "recipe/os/yum-family/AlmaLinux.c"
|
||||
#include "recipe/os/yum-family/Rocky-Linux.c"
|
||||
#include "recipe/os/yum-family/openEuler.c"
|
||||
#include "recipe/os/yum-family/Anolis-OS.c"
|
||||
|
||||
/**
|
||||
* HELP: 未经测试
|
||||
@@ -157,28 +158,6 @@ os_manjaro_setsrc (char *option)
|
||||
#include "recipe/os/openwrt.c"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 参考: https://mirrors.hust.edu.cn/docs/anolis
|
||||
*/
|
||||
void
|
||||
os_anolis_setsrc (char *option)
|
||||
{
|
||||
chsrc_ensure_root ();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_anolis);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_run ("dnf makecache", RunOpt_Default);
|
||||
chsrc_run ("dnf 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_noget(os_anolis);
|
||||
def_target_noget(os_msys2);
|
||||
TargetInfo os_manjaro_target = {NULL, os_manjaro_setsrc, NULL, NULL, 0};
|
||||
|
||||
@@ -70,7 +69,7 @@ static const char
|
||||
|
||||
*os_openkylin [] = {"openkylin", NULL, t(&os_openkylin_target)},
|
||||
*os_openeuler [] = {"openeuler", NULL, t(&os_openeuler_target)},
|
||||
*os_anolis [] = {"openanolis", NULL, t(&os_anolis_target)},
|
||||
*os_anolis [] = {"openanolis", "anolis", NULL, t(&os_anolis_target)},
|
||||
*os_deepin [] = {"deepin", NULL, t(&os_deepin_target)},
|
||||
|
||||
*os_freebsd [] = {"freebsd", NULL, t(&os_freebsd_target)},
|
||||
|
||||
44
src/recipe/os/yum-family/Anolis-OS.c
Normal file
44
src/recipe/os/yum-family/Anolis-OS.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/** ------------------------------------------------------------
|
||||
* 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-24>
|
||||
* Last Modified : <2024-08-16>
|
||||
*
|
||||
* Anolis OS 为这个操作系统的名字,OpenAnolis(龙蜥社区) 只是社区名
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @time 2024-06-12 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
os_anolis_sources[] = {
|
||||
{&Upstream, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/anolis"},
|
||||
{&Hust, "https://mirrors.hust.edu.cn/anolis"}
|
||||
};
|
||||
def_sources_n(os_anolis);
|
||||
|
||||
|
||||
/**
|
||||
* 参考: https://mirrors.hust.edu.cn/docs/anolis
|
||||
*/
|
||||
void
|
||||
os_anolis_setsrc (char *option)
|
||||
{
|
||||
chsrc_ensure_root ();
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_anolis);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char *cmd = xy_strjoin (3, "sed -i.bak -E 's|https?://(mirrors\\.openanolis\\.cn/anolis)|", source.url, "|g' /etc/yum.repos.d/*.repo");
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_run ("dnf makecache", RunOpt_Default);
|
||||
chsrc_run ("dnf update", RunOpt_No_Last_New_Line);
|
||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||
}
|
||||
|
||||
def_target_noget(os_anolis);
|
||||
Reference in New Issue
Block a user