mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-02 15:51:02 +08:00
Split alpine out
This commit is contained in:
parent
20bbd87956
commit
0cbc76c56e
|
@ -361,21 +361,6 @@ os_alma_sources[] = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @time 2024-04-18 更新
|
|
||||||
*/
|
|
||||||
os_alpine_sources[] = {
|
|
||||||
{&Upstream, NULL},
|
|
||||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/alpine"},
|
|
||||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/alpine"},
|
|
||||||
{&Sustech, "https://mirrors.sustech.edu.cn/alpine"},
|
|
||||||
{&Zju, "https://mirrors.zju.edu.cn/alpine"},
|
|
||||||
{&Lzuoss, "https://mirror.lzu.edu.cn/alpine"},
|
|
||||||
{&Ali, "https://mirrors.aliyun.com/alpine"},
|
|
||||||
{&Tencent, "https://mirrors.cloud.tencent.com/alpine"},
|
|
||||||
{&Huawei, "https://mirrors.huaweicloud.com/alpine"}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @time 2023-09-24 更新
|
* @time 2023-09-24 更新
|
||||||
|
@ -666,7 +651,7 @@ def_sources_n(os_debian); def_sources_n(os_fedora);
|
||||||
def_sources_n(os_kali); def_sources_n(os_opensuse);
|
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_alpine); 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_void);
|
||||||
def_sources_n(os_solus);
|
def_sources_n(os_solus);
|
||||||
|
|
||||||
|
|
30
src/chsrc.c
30
src/chsrc.c
|
@ -794,35 +794,7 @@ os_alma_setsrc (char *option)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include "recipe/os/alpine.c"
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
os_void_getsrc (char *option)
|
os_void_getsrc (char *option)
|
||||||
|
|
|
@ -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_alpine); def_target(os_void); def_target(os_trisquel); def_target(os_linuxlite);
|
def_target(os_void); 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);
|
||||||
|
|
55
src/recipe/os/alpine.c
Normal file
55
src/recipe/os/alpine.c
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/** ------------------------------------------------------------
|
||||||
|
* 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 2024-04-18 更新
|
||||||
|
*/
|
||||||
|
static SourceInfo
|
||||||
|
os_alpine_sources[] = {
|
||||||
|
{&Upstream, NULL},
|
||||||
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/alpine"},
|
||||||
|
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/alpine"},
|
||||||
|
{&Sustech, "https://mirrors.sustech.edu.cn/alpine"},
|
||||||
|
{&Zju, "https://mirrors.zju.edu.cn/alpine"},
|
||||||
|
{&Lzuoss, "https://mirror.lzu.edu.cn/alpine"},
|
||||||
|
{&Ali, "https://mirrors.aliyun.com/alpine"},
|
||||||
|
{&Tencent, "https://mirrors.cloud.tencent.com/alpine"},
|
||||||
|
{&Huawei, "https://mirrors.huaweicloud.com/alpine"}
|
||||||
|
};
|
||||||
|
def_sources_n(os_alpine);
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
def_target(os_alpine);
|
Loading…
Reference in New Issue
Block a user