Split gentoo out

This commit is contained in:
Aoran Zeng 2024-08-16 01:04:07 +08:00
parent 8fc2fb050b
commit 49c5c0163d
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
4 changed files with 55 additions and 42 deletions

View File

@ -282,21 +282,6 @@ os_archlinuxcn_sources[] = {
},
/**
* @time 2023-09-05
* @note
*/
os_gentoo_sources[] = {
{&Upstream, NULL},
{&Ali, "mirrors.aliyun.com"},
{&Bfsu, "mirrors.bfsu.edu.cn"},
{&Ustc, "mirrors.ustc.edu.cn"},
{&Tuna, "mirrors.tuna.tsinghua.edu.cn"},
{&Tencent, "mirrors.tencent.com"},
{&Netease, "mirrors.163.com"},
{&Sohu, "mirrors.sohu.com"}
},
/**
* @time 2024-06-12
@ -617,7 +602,7 @@ def_sources_n(os_ubuntu); def_sources_n(os_mint);
def_sources_n(os_debian); def_sources_n(os_fedora);
def_sources_n(os_kali); def_sources_n(os_opensuse);
def_sources_n(os_arch); def_sources_n(os_archlinuxcn);
def_sources_n(os_msys2); def_sources_n(os_gentoo);
def_sources_n(os_msys2);
def_sources_n(os_rocky); def_sources_n(os_alma);
def_sources_n(os_linuxlite); def_sources_n(os_raspberrypi);

View File

@ -723,32 +723,8 @@ os_archlinuxcn_setsrc (char *option)
}
#undef OS_Pacman_MirrorList
/**
* HELP:
*/
void
os_gentoo_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_gentoo);
chsrc_confirm_source (&source);
chsrc_backup ("/etc/portage/repos.conf/gentoo.conf");
char *cmd = xy_strjoin (3, "sed -i \"s#rsync://.*/gentoo-portage#rsync://",
source.url,
"gentoo-portage#g");
chsrc_run (cmd, RunOpt_Default);
char *towrite = xy_strjoin (3, "GENTOO_MIRRORS=\"https://", source.url, "gentoo\"");
chsrc_append_to_file (towrite, "/etc/portage/make.conf");
chsrc_say_lastly (&source, ChsrcTypeUntested);
}
#include "recipe/os/gentoo.c"
/**
* : https://help.mirrors.cernet.edu.cn/rocky/

View File

@ -48,7 +48,6 @@ def_target(os_armbian);
def_target(os_arch); def_target(os_archlinuxcn);
def_target_noget(os_fedora);
def_target_noget(os_opensuse);
def_target_noget(os_gentoo);
def_target_noget(os_rocky);
def_target_noget(os_alma);
def_target_noget(os_freebsd);

53
src/recipe/os/gentoo.c Normal file
View File

@ -0,0 +1,53 @@
/** ------------------------------------------------------------
* 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-05>
* Last Modified : <2024-08-16>
* ------------------------------------------------------------*/
/**
* @time 2023-09-05
* @note
*/
static SourceInfo
os_gentoo_sources[] = {
{&Upstream, NULL},
{&Ali, "mirrors.aliyun.com"},
{&Bfsu, "mirrors.bfsu.edu.cn"},
{&Ustc, "mirrors.ustc.edu.cn"},
{&Tuna, "mirrors.tuna.tsinghua.edu.cn"},
{&Tencent, "mirrors.tencent.com"},
{&Netease, "mirrors.163.com"},
{&Sohu, "mirrors.sohu.com"}
};
def_sources_n(os_gentoo);
/**
* HELP:
*/
void
os_gentoo_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_gentoo);
chsrc_confirm_source (&source);
chsrc_backup ("/etc/portage/repos.conf/gentoo.conf");
char *cmd = xy_strjoin (3, "sed -i \"s#rsync://.*/gentoo-portage#rsync://",
source.url,
"gentoo-portage#g");
chsrc_run (cmd, RunOpt_Default);
char *towrite = xy_strjoin (3, "GENTOO_MIRRORS=\"https://", source.url, "gentoo\"");
chsrc_append_to_file (towrite, "/etc/portage/make.conf");
chsrc_say_lastly (&source, ChsrcTypeUntested);
}
def_target_noget(os_gentoo);