mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-23 02:51:53 +08:00
Split alpine out
This commit is contained in:
30
src/chsrc.c
30
src/chsrc.c
@@ -794,35 +794,7 @@ os_alma_setsrc (char *option)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
os_alpine_getsrc (char *option)
|
||||
{
|
||||
chsrc_view_file ("/etc/apk/repositories");
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考: https://help.mirrors.cernet.edu.cn/alpine/
|
||||
*/
|
||||
void
|
||||
os_alpine_setsrc (char *option)
|
||||
{
|
||||
// chsrc_ensure_root(); // HELP: 不确定是否需要root
|
||||
|
||||
SourceInfo source;
|
||||
chsrc_yield_source (os_alpine);
|
||||
chsrc_confirm_source (&source);
|
||||
|
||||
char* cmd = xy_strjoin (3,
|
||||
"sed -i 's#https\\?://dl-cdn.alpinelinux.org/alpine#", source.url, "#g' /etc/apk/repositories"
|
||||
);
|
||||
chsrc_run (cmd, RunOpt_Default);
|
||||
|
||||
chsrc_run ("apk update", RunOpt_No_Last_New_Line);
|
||||
chsrc_say_lastly (&source, ChsrcTypeUntested);
|
||||
}
|
||||
|
||||
|
||||
#include "recipe/os/alpine.c"
|
||||
|
||||
void
|
||||
os_void_getsrc (char *option)
|
||||
|
||||
Reference in New Issue
Block a user