mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-04-23 12:44:15 +08:00
Split gentoo out
This commit is contained in:
parent
8fc2fb050b
commit
49c5c0163d
@ -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);
|
||||
|
26
src/chsrc.c
26
src/chsrc.c
@ -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/
|
||||
|
@ -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
53
src/recipe/os/gentoo.c
Normal 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);
|
Loading…
x
Reference in New Issue
Block a user