forked from RubyMetric/chsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArmbian.c
81 lines (66 loc) · 2.22 KB
/
Armbian.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/** ------------------------------------------------------------
* SPDX-License-Identifier: GPL-3.0-or-later
* -------------------------------------------------------------
* File Authors : Shengwei Chen <[email protected]>
* Contributors : Aoran Zeng <[email protected]>
* | Yangmoooo <[email protected]>
* |
* Created On : <2024-06-14>
* Last Modified : <2024-11-21>
* ------------------------------------------------------------*/
/**
* @update 2024-11-21
*/
static Source_t os_armbian_sources[] =
{
{&UpstreamProvider, "http://apt.armbian.com"},
{&MirrorZ, "https://mirrors.cernet.edu.cn/armbian"},
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/armbian"},
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/armbian"},
{&Bfsu, "https://mirrors.bfsu.edu.cn/armbian"},
{&Sustech, "https://mirrors.sustech.edu.cn/armbian"},
{&Ustc, "https://mirrors.ustc.edu.cn/armbian"},
{&Nju, "https://mirrors.nju.edu.cn/armbian"},
{&Ali, "https://mirrors.aliyun.com/armbian"},
};
def_sources_n(os_armbian);
void
os_armbian_getsrc (char *option)
{
if (chsrc_check_file (OS_Armbian_SourceList))
{
chsrc_view_file (OS_Armbian_SourceList);
return;
}
char *msg = CliOpt_InEnglish ? "Source list config file missing! Path: " OS_Armbian_SourceList
: "缺少源配置文件!路径:" OS_Armbian_SourceList;
chsrc_error2 (msg);
}
/**
* @consult https://mirrors.tuna.tsinghua.edu.cn/help/armbian
*/
void
os_armbian_setsrc (char *option)
{
chsrc_ensure_root ();
chsrc_yield_source_and_confirm (os_armbian);
chsrc_backup (OS_Armbian_SourceList);
char *cmd = xy_strjoin (3, "sed -E -i 's@https?[^ ]*armbian/?[^ ]*@", source.url,
"@g' " OS_Armbian_SourceList);
chsrc_run (cmd, RunOpt_Default);
chsrc_run ("apt update", RunOpt_No_Last_New_Line);
ProgMode_ChgType = ChgType_Auto;
chsrc_conclude (&source);
}
Feature_t
os_armbian_feat (char *option)
{
Feature_t f = {0};
f.can_get = true;
f.can_reset = false;
f.cap_locally = CanNot;
f.can_english = true;
f.can_user_define = true;
return f;
}
def_target_gsf(os_armbian);