mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-23 02:51:53 +08:00
Split void out
This commit is contained in:
39
src/chsrc.c
39
src/chsrc.c
@@ -795,44 +795,7 @@ os_alma_setsrc (char *option)
|
||||
|
||||
|
||||
#include "recipe/os/alpine.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);
|
||||
}
|
||||
|
||||
#include "recipe/os/void.c"
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user