chsrc/src/recipe/os/APT/deepin.c
2025-03-06 12:36:16 +08:00

60 lines
1.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Heng Guo <2085471348@qq.com>
* Contributors : Yangmoooo <yangmoooo@outlook.com>
* Created On : <2023-09-26>
* Last Modified : <2024-09-14>
*
* 名称为小写deepin而非Deepin
* ------------------------------------------------------------*/
/**
* @update 2024-09-14
*/
static Source_t os_deepin_sources[] =
{
{&UpstreamProvider, "https://community-packages.deepin.com/deepin"},
{&Ali, "https://mirrors.aliyun.com/deepin"},
{&Bfsu, "https://mirrors.bfsu.edu.cn/deepin"},
{&Ustc, "https://mirrors.ustc.edu.cn/deepin"},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/deepin"},
{&Tencent, "https://mirrors.tencent.com/deepin"},
// {&Tencent_Intra, "https://mirrors.tencentyun.com/deepin"},
{&Netease, "https://mirrors.163.com/deepin"},
{&Sohu, "https://mirrors.sohu.com/deepin"}
};
def_sources_n(os_deepin);
void
os_deepin_getsrc(char *option)
{
chsrc_view_file (OS_Apt_SourceList);
}
/**
* HELP: 未经测试
*/
void
os_deepin_setsrc (char *option)
{
chsrc_ensure_root();
chsrc_yield_source_and_confirm (os_deepin);
chsrc_backup (OS_Apt_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i \'s@https?://.*/deepin/?@",
source.url,
"@g\' " OS_Apt_SourceList);
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
chsrc_determine_chgtype (ChgType_Untested);
chsrc_conclude (&source);
}
def_target(os_deepin);