Split anolis out

This commit is contained in:
Aoran Zeng
2024-08-16 03:50:03 +08:00
parent 415d5d2092
commit 62781f54c3
5 changed files with 74 additions and 67 deletions

View File

@@ -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"

View File

@@ -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)},

View 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);