mirror of
https://github.com/RubyMetric/chsrc.git
synced 2024-11-27 03:13:41 +08:00
Add feature os-netbsd
This commit is contained in:
parent
898c7cf24c
commit
cf33530bc1
10
chsrc.c
10
chsrc.c
|
@ -840,7 +840,7 @@ os_ubuntu_setsrc (char* option)
|
||||||
|
|
||||||
xy_info ("chsrc: 备份文件名: /etc/apt/sources.list.bak");
|
xy_info ("chsrc: 备份文件名: /etc/apt/sources.list.bak");
|
||||||
|
|
||||||
char* arch = xy_getcmd("arch");
|
char* arch = xy_getcmd("arch",NULL);
|
||||||
char* cmd;
|
char* cmd;
|
||||||
if(strncmp(arch,"x86_64",6)==0)
|
if(strncmp(arch,"x86_64",6)==0)
|
||||||
{
|
{
|
||||||
|
@ -1187,6 +1187,8 @@ os_netbsd_setsrc(char* option)
|
||||||
|
|
||||||
xy_info ("chsrc: 备份文件名: /usr/pkg/etc/pkgin/repositories.conf.bak");
|
xy_info ("chsrc: 备份文件名: /usr/pkg/etc/pkgin/repositories.conf.bak");
|
||||||
|
|
||||||
|
char* arch = xy_getcmd("arch",NULL);
|
||||||
|
char* version = "cat /etc/os-release | grep \"VERSION=\" | grep -Po [8-9].[0-9]+";
|
||||||
char* cmd = xy_strjoin(6,"echo ",
|
char* cmd = xy_strjoin(6,"echo ",
|
||||||
source.url,
|
source.url,
|
||||||
arch,
|
arch,
|
||||||
|
@ -1249,7 +1251,8 @@ target_info
|
||||||
os_openbsd_target = {os_openbsd_setsrc, NULL, os_openbsd_sources, 7},
|
os_openbsd_target = {os_openbsd_setsrc, NULL, os_openbsd_sources, 7},
|
||||||
os_mysys2_target = {os_mysys2_setsrc, NULL, os_mysys2_sources, 7},
|
os_mysys2_target = {os_mysys2_setsrc, NULL, os_mysys2_sources, 7},
|
||||||
os_arch_target = {os_arch_setsrc, NULL, os_arch_sources, 7},
|
os_arch_target = {os_arch_setsrc, NULL, os_arch_sources, 7},
|
||||||
os_gentoo_target = {os_gentoo_setsrc, NULL, os_gentoo_sources, 7};
|
os_gentoo_target = {os_gentoo_setsrc, NULL, os_gentoo_sources, 7},
|
||||||
|
os_netbsd_target = {os_netbsd_setsrc, NULL, os_netbsd_sources, 7};
|
||||||
static const char const
|
static const char const
|
||||||
*os_ubuntu [] = {"ubuntu", NULL, targetinfo(&os_ubuntu_target)},
|
*os_ubuntu [] = {"ubuntu", NULL, targetinfo(&os_ubuntu_target)},
|
||||||
*os_debian [] = {"debian", NULL, targetinfo(&os_debian_target)},
|
*os_debian [] = {"debian", NULL, targetinfo(&os_debian_target)},
|
||||||
|
@ -1259,9 +1262,10 @@ static const char const
|
||||||
*os_mysys2 [] = {"mysys2", NULL, targetinfo(&os_mysys2_target)},
|
*os_mysys2 [] = {"mysys2", NULL, targetinfo(&os_mysys2_target)},
|
||||||
*os_arch [] = {"arch", NULL, targetinfo(&os_arch_target)},
|
*os_arch [] = {"arch", NULL, targetinfo(&os_arch_target)},
|
||||||
*os_gentoo [] = {"gentoo", NULL, targetinfo(&os_gentoo_target)},
|
*os_gentoo [] = {"gentoo", NULL, targetinfo(&os_gentoo_target)},
|
||||||
|
*os_netbsd [] = {"netbsd", NULL, targetinfo(&os_netbsd_target)},
|
||||||
**os_systems[] =
|
**os_systems[] =
|
||||||
{
|
{
|
||||||
os_ubuntu, os_debian,os_fedora,os_kali,os_openbsd,os_mysys2,os_arch,os_gentoo
|
os_ubuntu, os_debian,os_fedora,os_kali,os_openbsd,os_mysys2,os_arch,os_gentoo,os_netbsd
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
17
chsrc.h
17
chsrc.h
|
@ -403,6 +403,21 @@ os_gentoo_sources[] = {
|
||||||
{&Tencent, "mirrors.tencent.com"},
|
{&Tencent, "mirrors.tencent.com"},
|
||||||
{&Netease, "mirrors.163.com"},
|
{&Netease, "mirrors.163.com"},
|
||||||
{&Sohu, "mirrors.sohu.com"}
|
{&Sohu, "mirrors.sohu.com"}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2023-09-05 更新
|
||||||
|
*
|
||||||
|
* TODO: 1. 源并不完整,且未经测试是否有效
|
||||||
|
*/
|
||||||
|
os_netbsd_sources[] = {
|
||||||
|
{&Ali, "https://mirrors.aliyun.com/pkgsrc/packages/NetBSD/"},
|
||||||
|
{&Bfsu, "https://mirrors.bfsu.edu.cn/pkgsrc/packages/NetBSD/"},
|
||||||
|
{&Ustc, "https://mirrors.ustc.edu.cn/pkgsrc/packages/NetBSD/"},
|
||||||
|
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/pkgsrc/packages/NetBSD/"},
|
||||||
|
{&Tencent, "https://mirrors.tencent.com/pkgsrc/packages/NetBSD/"},
|
||||||
|
{&Netease, "https://mirrors.163.com/pkgsrc/packages/NetBSD/"},
|
||||||
|
{&Sohu, "https://mirrors.sohu.com/pkgsrc/packages/NetBSD/"}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -456,7 +471,7 @@ def_target_sources_n(pl_r); def_target_sources_n(pl_julia);
|
||||||
|
|
||||||
def_target_sources_n(os_ubuntu); def_target_sources_n(os_debian); def_target_sources_n(os_fedora);
|
def_target_sources_n(os_ubuntu); def_target_sources_n(os_debian); def_target_sources_n(os_fedora);
|
||||||
def_target_sources_n(os_kali); def_target_sources_n(os_openbsd); def_target_sources_n(os_mysys2);
|
def_target_sources_n(os_kali); def_target_sources_n(os_openbsd); def_target_sources_n(os_mysys2);
|
||||||
def_target_sources_n(os_arch); def_target_sources_n(os_gentoo);
|
def_target_sources_n(os_arch); def_target_sources_n(os_gentoo); def_target_sources_n(os_netbsd);
|
||||||
|
|
||||||
/* Target Info */
|
/* Target Info */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user