Split openbsd out

This commit is contained in:
Aoran Zeng 2024-08-16 01:21:05 +08:00
parent c96323c6bd
commit ccaf8d2b33
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
4 changed files with 57 additions and 44 deletions

View File

@ -370,21 +370,6 @@ os_netbsd_sources[] = {
},
/**
* @time 2023-09-02
* @note
*/
os_openbsd_sources[] = {
{&Upstream, NULL},
{&Ali, "https://mirrors.aliyun.com/OpenBSD/"},
{&Bfsu, "https://mirrors.bfsu.edu.cn/OpenBSD/"},
{&Ustc, "https://mirrors.ustc.edu.cn/OpenBSD/"},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/OpenBSD/"},
{&Tencent, "https://mirrors.tencent.com/OpenBSD/"},
{&Netease, "https://mirrors.163.com/OpenBSD/"},
{&Sohu, "https://mirrors.sohu.com/OpenBSD/"}
},
/**
* @time 2023-09-06
@ -559,7 +544,7 @@ def_sources_n(os_rocky); def_sources_n(os_alma);
def_sources_n(os_linuxlite); def_sources_n(os_raspberrypi);
def_sources_n(os_armbian);
def_sources_n(os_freebsd); def_sources_n(os_netbsd); def_sources_n(os_openbsd);
def_sources_n(os_freebsd); def_sources_n(os_netbsd);
def_sources_n(os_ros);

View File

@ -898,33 +898,7 @@ os_netbsd_setsrc (char *option)
chsrc_say_lastly (&source, ChsrcTypeUntested);
}
void
os_openbsd_getsrc (char *option)
{
chsrc_view_file ("/etc/installurl");
}
/**
*
* 1. https://mirrors.tuna.tsinghua.edu.cn/help/openbsd/
* 2. https://book.bsdcn.org/di-26-zhang-openbsd/di-26.2-jie-pei-zhi.html
*/
void
os_openbsd_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_openbsd);
chsrc_confirm_source (&source);
chsrc_backup ("/etc/installurl");
chsrc_overwrite_file (source.url, "/etc/installurl");
chsrc_say_lastly (&source, ChsrcTypeUntested);
}
#include "recipe/os/openbsd.c"
/**
*

View File

@ -41,7 +41,7 @@ static const char
def_target(os_ubuntu); def_target(os_mint); def_target(os_debian); def_target(os_kali);
def_target(os_linuxlite);
def_target(os_netbsd); def_target(os_openbsd);
def_target(os_netbsd);
def_target(os_deepin); def_target(os_openkylin);
def_target(os_raspberrypi);
def_target(os_armbian);

54
src/recipe/os/openbsd.c Normal file
View File

@ -0,0 +1,54 @@
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Heng Guo <2085471348@qq.com>
* | Aoran Zeng <ccmywish@qq.com>
* Contributors : Nil Null <nil@null.org>
* Created On : <2023-09-03>
* Last Modified : <2024-08-16>
* ------------------------------------------------------------*/
/**
* @time 2023-09-02
*/
static SourceInfo
os_openbsd_sources[] = {
{&Upstream, NULL},
{&Ali, "https://mirrors.aliyun.com/OpenBSD/"},
{&Bfsu, "https://mirrors.bfsu.edu.cn/OpenBSD/"},
{&Ustc, "https://mirrors.ustc.edu.cn/OpenBSD/"},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/OpenBSD/"},
{&Tencent, "https://mirrors.tencent.com/OpenBSD/"},
{&Netease, "https://mirrors.163.com/OpenBSD/"},
{&Sohu, "https://mirrors.sohu.com/OpenBSD/"}
};
def_sources_n(os_openbsd);
void
os_openbsd_getsrc (char *option)
{
chsrc_view_file ("/etc/installurl");
}
/**
*
* 1. https://mirrors.tuna.tsinghua.edu.cn/help/openbsd/
* 2. https://book.bsdcn.org/di-26-zhang-openbsd/di-26.2-jie-pei-zhi.html
*/
void
os_openbsd_setsrc (char *option)
{
chsrc_ensure_root ();
SourceInfo source;
chsrc_yield_source (os_openbsd);
chsrc_confirm_source (&source);
chsrc_backup ("/etc/installurl");
chsrc_overwrite_file (source.url, "/etc/installurl");
chsrc_say_lastly (&source, ChsrcTypeUntested);
}
def_target(os_openbsd);