mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-24 05:14:09 +08:00
Split void out
This commit is contained in:
parent
0cbc76c56e
commit
03e4556718
@ -362,16 +362,6 @@ os_alma_sources[] = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @time 2023-09-24 更新
|
|
||||||
*/
|
|
||||||
os_void_sources[] = {
|
|
||||||
{&Upstream, NULL},
|
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/voidlinux"},
|
|
||||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/voidlinux"},
|
|
||||||
{&Bfsu, "https://mirrors.bfsu.edu.cn/voidlinux"}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @time 2023-09-29 更新
|
* @time 2023-09-29 更新
|
||||||
@ -652,7 +642,6 @@ def_sources_n(os_kali); def_sources_n(os_opensuse);
|
|||||||
def_sources_n(os_arch); def_sources_n(os_archlinuxcn);
|
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_gentoo);
|
||||||
def_sources_n(os_rocky); def_sources_n(os_alma);
|
def_sources_n(os_rocky); def_sources_n(os_alma);
|
||||||
def_sources_n(os_void);
|
|
||||||
def_sources_n(os_solus);
|
def_sources_n(os_solus);
|
||||||
|
|
||||||
def_sources_n(os_trisquel); def_sources_n(os_linuxlite); def_sources_n(os_raspberrypi);
|
def_sources_n(os_trisquel); def_sources_n(os_linuxlite); def_sources_n(os_raspberrypi);
|
||||||
|
39
src/chsrc.c
39
src/chsrc.c
@ -795,44 +795,7 @@ os_alma_setsrc (char *option)
|
|||||||
|
|
||||||
|
|
||||||
#include "recipe/os/alpine.c"
|
#include "recipe/os/alpine.c"
|
||||||
|
#include "recipe/os/void.c"
|
||||||
void
|
|
||||||
os_void_getsrc (char *option)
|
|
||||||
{
|
|
||||||
char* cmd = "xbps-query -L";
|
|
||||||
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参考: https://help.mirrors.cernet.edu.cn/voidlinux/
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
os_void_setsrc (char *option)
|
|
||||||
{
|
|
||||||
// chsrc_ensure_root(); // HELP: 不确定是否需要root
|
|
||||||
|
|
||||||
SourceInfo source;
|
|
||||||
chsrc_yield_source (os_void);
|
|
||||||
chsrc_confirm_source (&source);
|
|
||||||
|
|
||||||
chsrc_ensure_dir ("/etc/xbps.d");
|
|
||||||
char *cmd = "cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/";
|
|
||||||
chsrc_run (cmd, RunOpt_Default);
|
|
||||||
|
|
||||||
cmd = xy_strjoin (3,
|
|
||||||
"sed -i 's|https://repo-default.voidlinux.org|", source.url, "|g' /etc/xbps.d/*-repository-*.conf"
|
|
||||||
);
|
|
||||||
chsrc_run (cmd, RunOpt_Default);
|
|
||||||
|
|
||||||
cmd = xy_strjoin (3,
|
|
||||||
"sed -i 's|https://alpha.de.repo.voidlinux.org|", source.url, "|g' /etc/xbps.d/*-repository-*.conf"
|
|
||||||
);
|
|
||||||
|
|
||||||
chsrc_note2 ("若报错可尝试使用以下命令:");
|
|
||||||
puts (cmd);
|
|
||||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +40,7 @@ static const char
|
|||||||
|
|
||||||
|
|
||||||
def_target(os_ubuntu); def_target(os_mint); def_target(os_debian); def_target(os_kali);
|
def_target(os_ubuntu); def_target(os_mint); def_target(os_debian); def_target(os_kali);
|
||||||
def_target(os_void); def_target(os_trisquel); def_target(os_linuxlite);
|
def_target(os_trisquel); def_target(os_linuxlite);
|
||||||
def_target(os_netbsd); def_target(os_openbsd);
|
def_target(os_netbsd); def_target(os_openbsd);
|
||||||
def_target(os_deepin); def_target(os_openkylin);
|
def_target(os_deepin); def_target(os_openkylin);
|
||||||
def_target(os_raspberrypi);
|
def_target(os_raspberrypi);
|
||||||
|
60
src/recipe/os/void.c
Normal file
60
src/recipe/os/void.c
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/** ------------------------------------------------------------
|
||||||
|
* 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-09>
|
||||||
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @time 2023-09-24 更新
|
||||||
|
*/
|
||||||
|
static SourceInfo
|
||||||
|
os_void_sources[] = {
|
||||||
|
{&Upstream, NULL},
|
||||||
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/voidlinux"},
|
||||||
|
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/voidlinux"},
|
||||||
|
{&Bfsu, "https://mirrors.bfsu.edu.cn/voidlinux"}
|
||||||
|
};
|
||||||
|
def_sources_n(os_void);
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
os_void_getsrc (char *option)
|
||||||
|
{
|
||||||
|
char* cmd = "xbps-query -L";
|
||||||
|
chsrc_run (cmd, RunOpt_No_Last_New_Line);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参考: https://help.mirrors.cernet.edu.cn/voidlinux/
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
os_void_setsrc (char *option)
|
||||||
|
{
|
||||||
|
// chsrc_ensure_root(); // HELP: 不确定是否需要root
|
||||||
|
|
||||||
|
SourceInfo source;
|
||||||
|
chsrc_yield_source (os_void);
|
||||||
|
chsrc_confirm_source (&source);
|
||||||
|
|
||||||
|
chsrc_ensure_dir ("/etc/xbps.d");
|
||||||
|
char *cmd = "cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/";
|
||||||
|
chsrc_run (cmd, RunOpt_Default);
|
||||||
|
|
||||||
|
cmd = xy_strjoin (3,
|
||||||
|
"sed -i 's|https://repo-default.voidlinux.org|", source.url, "|g' /etc/xbps.d/*-repository-*.conf"
|
||||||
|
);
|
||||||
|
chsrc_run (cmd, RunOpt_Default);
|
||||||
|
|
||||||
|
cmd = xy_strjoin (3,
|
||||||
|
"sed -i 's|https://alpha.de.repo.voidlinux.org|", source.url, "|g' /etc/xbps.d/*-repository-*.conf"
|
||||||
|
);
|
||||||
|
|
||||||
|
chsrc_note2 ("若报错可尝试使用以下命令:");
|
||||||
|
puts (cmd);
|
||||||
|
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||||
|
}
|
||||||
|
|
||||||
|
def_target(os_void);
|
Loading…
x
Reference in New Issue
Block a user