mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-28 07:22:48 +08:00
Rename struct
This commit is contained in:
parent
b8f847a9ce
commit
743380290e
@ -217,7 +217,7 @@ cli_print_available_mirrors ()
|
||||
|
||||
for (int i = 0; i < xy_arylen (available_mirrors); i++)
|
||||
{
|
||||
MirrorSite* mir = available_mirrors[i];
|
||||
MirrorSite_t *mir = available_mirrors[i];
|
||||
printf ("%-14s%-18s%-41s ", mir->code, mir->abbr, mir->site); say (mir->name);
|
||||
}
|
||||
}
|
||||
@ -305,12 +305,12 @@ cli_print_supported_wr ()
|
||||
* 用于 chsrc list <target>
|
||||
*/
|
||||
void
|
||||
cli_print_target_available_sources (SourceInfo sources[], size_t size)
|
||||
cli_print_target_available_sources (Source_t sources[], size_t size)
|
||||
{
|
||||
for (int i=0;i<size;i++)
|
||||
{
|
||||
SourceInfo src = sources[i];
|
||||
const MirrorSite *mir = src.mirror;
|
||||
Source_t src = sources[i];
|
||||
const MirrorSite_t *mir = src.mirror;
|
||||
if (NULL == src.url)
|
||||
{
|
||||
src.url = "Please help to add the upstream url!";
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Name : core.h
|
||||
* File Name : core.c
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* | Heng Guo <2085471348@qq.com>
|
||||
* Contributors : Peng Gao <gn3po4g@outlook.com>
|
||||
@ -330,7 +330,7 @@ chsrc_check_file (char *path)
|
||||
*/
|
||||
#define find_mirror(s, input) query_mirror_exist(s##_sources, s##_sources_n, (char*)#s+3, input)
|
||||
int
|
||||
query_mirror_exist (SourceInfo *sources, size_t size, char *target, char *input)
|
||||
query_mirror_exist (Source_t *sources, size_t size, char *target, char *input)
|
||||
{
|
||||
if (is_url (input))
|
||||
{
|
||||
@ -372,7 +372,7 @@ query_mirror_exist (SourceInfo *sources, size_t size, char *target, char *input)
|
||||
}
|
||||
|
||||
int idx = 0;
|
||||
SourceInfo source = sources[0];
|
||||
Source_t source = sources[0];
|
||||
|
||||
bool exist = false;
|
||||
for (int i=0; i<size; i++)
|
||||
@ -563,7 +563,7 @@ get_max_ele_idx_in_dbl_ary (double *array, int size)
|
||||
* @param[out] speed_records 速度值记录,单位为Byte/s
|
||||
*/
|
||||
void
|
||||
measure_speed_for_every_source (SourceInfo sources[], int size, double speed_records[])
|
||||
measure_speed_for_every_source (Source_t sources[], int size, double speed_records[])
|
||||
{
|
||||
bool get_measured[size]; /* 是否真正执行了测速 */
|
||||
int get_measured_n = 0; /* 测速了几个 */
|
||||
@ -573,9 +573,9 @@ measure_speed_for_every_source (SourceInfo sources[], int size, double speed_rec
|
||||
|
||||
for (int i=0; i<size; i++)
|
||||
{
|
||||
SourceInfo src = sources[i];
|
||||
Source_t src = sources[i];
|
||||
|
||||
const SpeedMeasureInfo smi = src.mirror->smi;
|
||||
const SpeedMeasureInfo_t smi = src.mirror->smi;
|
||||
|
||||
bool skip = smi.skip;
|
||||
|
||||
@ -647,7 +647,7 @@ measure_speed_for_every_source (SourceInfo sources[], int size, double speed_rec
|
||||
*/
|
||||
#define auto_select_mirror(s) select_mirror_autoly(s##_sources, s##_sources_n, (char*)#s+3)
|
||||
int
|
||||
select_mirror_autoly (SourceInfo *sources, size_t size, const char *target_name)
|
||||
select_mirror_autoly (Source_t *sources, size_t size, const char *target_name)
|
||||
{
|
||||
{
|
||||
char *msg = CliOpt_InEnglish ? "Measuring speed in sequence" : "测速中";
|
||||
@ -732,19 +732,19 @@ select_mirror_autoly (SourceInfo *sources, size_t size, const char *target_name)
|
||||
|
||||
|
||||
bool
|
||||
source_is_upstream (SourceInfo *source)
|
||||
source_is_upstream (Source_t *source)
|
||||
{
|
||||
return xy_streql (source->mirror->code, "upstream");
|
||||
}
|
||||
|
||||
bool
|
||||
source_is_userdefine (SourceInfo *source)
|
||||
source_is_userdefine (Source_t *source)
|
||||
{
|
||||
return xy_streql (source->mirror->code, "user");
|
||||
}
|
||||
|
||||
bool
|
||||
source_has_empty_url (SourceInfo *source)
|
||||
source_has_empty_url (Source_t *source)
|
||||
{
|
||||
return source->url == NULL;
|
||||
}
|
||||
@ -752,7 +752,7 @@ source_has_empty_url (SourceInfo *source)
|
||||
|
||||
|
||||
/**
|
||||
* 用户*只可能*通过下面5种方式来换源,无论哪一种都会返回一个 SourceInfo 出来
|
||||
* 用户*只可能*通过下面5种方式来换源,无论哪一种都会返回一个 Source_t 出来
|
||||
* option:
|
||||
* 1. 用户指定某个 MirrorCode
|
||||
* 2. NULL: 用户什么都没指定 (将测速选择最快镜像)
|
||||
@ -775,7 +775,7 @@ source_has_empty_url (SourceInfo *source)
|
||||
} \
|
||||
else if (is_url (option)) \
|
||||
{ \
|
||||
SourceInfo __tmp = { &UserDefinedProvider, option }; \
|
||||
Source_t __tmp = { &UserDefinedProvider, option }; \
|
||||
source = __tmp; \
|
||||
} \
|
||||
else \
|
||||
@ -785,7 +785,7 @@ source_has_empty_url (SourceInfo *source)
|
||||
}
|
||||
|
||||
#define chsrc_yield_source(for_what) \
|
||||
SourceInfo source; \
|
||||
Source_t source; \
|
||||
chsrc_yield_for_the_source(for_what)
|
||||
|
||||
|
||||
@ -803,7 +803,7 @@ source_has_empty_url (SourceInfo *source)
|
||||
*/
|
||||
#define chsrc_confirm_source confirm_source(&source)
|
||||
void
|
||||
confirm_source (SourceInfo *source)
|
||||
confirm_source (Source_t *source)
|
||||
{
|
||||
// 由于实现问题,我们把本应该独立出去的默认上游源,也放在了可以换源的数组中,而且放在第一个
|
||||
// chsrc 已经规避用户使用未实现的 `chsrc reset`
|
||||
@ -869,7 +869,7 @@ confirm_source (SourceInfo *source)
|
||||
* @translation Done
|
||||
*/
|
||||
void
|
||||
chsrc_conclude (SourceInfo *source, const char *last_word)
|
||||
chsrc_conclude (Source_t *source, const char *last_word)
|
||||
{
|
||||
split_between_source_changing_process;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Name : mirror.c
|
||||
* File Name : mirror.c
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* | Heng Guo <2085471348@qq.com>
|
||||
* Contributors : Shengwei Chen <414685209@qq.com>
|
||||
@ -24,7 +24,7 @@
|
||||
*
|
||||
* Wiki中的排序是根据 https://github.com/mirrorz-org/oh-my-mirrorz 挑选速度前10位
|
||||
*/
|
||||
MirrorSite
|
||||
MirrorSite_t
|
||||
MirrorZ = {
|
||||
"mirrorz", "MirrorZ", "MirrorZ 校园网镜像站", "https://mirrors.cernet.edu.cn/",
|
||||
{SKIP, "功能特殊无法测速,跳过", "SKIP because of its special function"}
|
||||
@ -116,7 +116,7 @@ Nju = {
|
||||
/**
|
||||
* 商业公司提供的源
|
||||
*/
|
||||
MirrorSite
|
||||
MirrorSite_t
|
||||
Ali = {
|
||||
"ali", "Ali OPSX Public", "阿里巴巴开源镜像站(公网)", "https://developer.aliyun.com/mirror/",
|
||||
{NotSkip, NA, NA, "https://mirrors.aliyun.com/deepin-cd" Big_File_deepin}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Name : struct.h
|
||||
* File Name : struct.h
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* | Heng Guo <2085471348@qq.com>
|
||||
* Contributors : Shengwei Chen <414685209@qq.com>
|
||||
@ -19,7 +19,7 @@ typedef struct SpeedMeasureInfo_t
|
||||
const char *skip_reason_EN; /* 跳过的原因(英文)*/
|
||||
const char *url; /* 测速链接 */
|
||||
}
|
||||
SpeedMeasureInfo;
|
||||
SpeedMeasureInfo_t;
|
||||
|
||||
#define SKIP true
|
||||
#define NotSkip false
|
||||
@ -32,35 +32,35 @@ typedef struct SourceProvider_t
|
||||
const char *abbr; /* 需要使用 Provider 的英文名时,用这个代替,因为大部分 Provider 没有提供正式的英文名 */
|
||||
const char *name; /* Provider 中文名 */
|
||||
const char *site; /* Provider 首页 */
|
||||
SpeedMeasureInfo smi;
|
||||
SpeedMeasureInfo_t smi;
|
||||
}
|
||||
SourceProvider;
|
||||
SourceProvider_t;
|
||||
|
||||
typedef SourceProvider MirrorSite;
|
||||
typedef SourceProvider_t MirrorSite_t;
|
||||
|
||||
SourceProvider
|
||||
SourceProvider_t
|
||||
UpstreamProvider = {
|
||||
"upstream", "Upstream", "上游默认源", NULL,
|
||||
{SKIP, "上游默认源不测速", "SKIP for upstream source", NULL}
|
||||
};
|
||||
|
||||
SourceProvider
|
||||
SourceProvider_t
|
||||
UserDefinedProvider = {
|
||||
"user", "用户自定义", "用户自定义", NULL,
|
||||
{SKIP, "用户自定义源不测速", "SKIP for user-defined source", NULL}
|
||||
};
|
||||
|
||||
|
||||
typedef struct SourceInfo_t
|
||||
typedef struct Source_t
|
||||
{
|
||||
const MirrorSite *mirror;
|
||||
const MirrorSite_t *mirror;
|
||||
const char *url;
|
||||
}
|
||||
SourceInfo;
|
||||
Source_t;
|
||||
|
||||
#define def_sources_n(t) const size_t t##_sources_n = xy_arylen(t##_sources)
|
||||
|
||||
enum Capability
|
||||
enum Capability_t
|
||||
{
|
||||
CanNot,
|
||||
FullyCan,
|
||||
@ -78,7 +78,7 @@ typedef struct FeatInfo_t
|
||||
|
||||
bool can_user_define; /* 用户自定义换源URL */
|
||||
|
||||
enum Capability cap_locally;
|
||||
enum Capability_t cap_locally;
|
||||
char *cap_locally_explain;
|
||||
|
||||
char *note;
|
||||
@ -95,7 +95,7 @@ typedef struct TargetInfo_t
|
||||
|
||||
FeatInfo (*featfn) (char *option);
|
||||
|
||||
SourceInfo *sources;
|
||||
Source_t *sources;
|
||||
size_t sources_n;
|
||||
}
|
||||
TargetInfo;
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @time 2023-09-10 更新
|
||||
* @note 不太好换,且用户可能不多,我们暂时只给用户提供文档
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_clojure_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/help/clojars/"},
|
||||
|
@ -15,7 +15,7 @@
|
||||
/**
|
||||
* @update 2024-10-31
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_dart_flutter_sources[] = {
|
||||
{&UpstreamProvider, "https://storage.googleapis.com"},
|
||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn"}, // 没有后缀,怀疑是否存在问题
|
||||
|
@ -14,7 +14,7 @@
|
||||
/**
|
||||
* @update 2024-10-31
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_dart_sources[] = {
|
||||
{&UpstreamProvider, "https://pub.dev"},
|
||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/dart-pub"},
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Last Modified : <2024-10-31>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
GoProxyCN = {
|
||||
"goproxy.cn", "Goproxy.cn", "Goproxy.cn (七牛云)", "https://goproxy.cn/",
|
||||
{NotSkip, NA, NA, "https://goproxy.cn/github.com/aws/aws-sdk-go/@v/v1.45.2.zip"} // 30 MB
|
||||
@ -25,7 +25,7 @@ GoProxyIO = {
|
||||
* @update 2024-10-31
|
||||
* @note 缺少教育网软件源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_go_sources[] = {
|
||||
{&UpstreamProvider, "https://proxy.golang.org"},
|
||||
{&GoProxyCN, "https://goproxy.cn"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @time 2023-09-10 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_haskell_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/hackage"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @time 2024-04-18 更新
|
||||
* @note 缺少教育网或开源社区软件源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_java_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://maven.aliyun.com/repository/public/"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @time 2023-09-05 更新
|
||||
* @note 缺少商业公司或开源社区软件源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_julia_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/julia"},
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Last Modified : <2024-08-09>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
Api7 = {
|
||||
"api7", "api7.ai", "深圳支流科技有限公司", "https://www.apiseven.com/",
|
||||
{SKIP, ToFill, ToFill, NULL}
|
||||
@ -18,7 +18,7 @@ Api7 = {
|
||||
* @time 2023-09-27 更新
|
||||
* @note 目前只有一个源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_lua_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Api7, "https://luarocks.cn"},
|
||||
|
@ -40,7 +40,7 @@ pl_nodejs_yarn_getsrc (char *option)
|
||||
void
|
||||
pl_nodejs_yarn_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_nodejs);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Last Modified : <2024-09-23>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
NpmMirror = {
|
||||
"npmmirror", "npmmirror", "npmmirror (阿里云赞助)", "https://npmmirror.com/",
|
||||
// 注意,下面这个是跳转后的地址,不确定未来会不会改变
|
||||
@ -26,7 +26,7 @@ NpmMirror = {
|
||||
* }
|
||||
*
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_nodejs_sources[] = {
|
||||
{&UpstreamProvider, "https://registry.npmjs.org/"}, // @note 根据 pnpm 官网,有最后的斜线
|
||||
{&NpmMirror, "https://registry.npmmirror.com"},
|
||||
@ -43,7 +43,7 @@ def_sources_n(pl_nodejs);
|
||||
* @sync https://github.com/RubyMetric/chsrc/discussions/85
|
||||
*
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_nodejs_binary_release_sources[] = {
|
||||
{&UpstreamProvider, "https://nodejs.org/dist/"},
|
||||
{&NpmMirror, "https://npmmirror.com/mirrors"},
|
||||
|
@ -26,7 +26,7 @@ pl_nodejs_npm_getsrc (char *option)
|
||||
void
|
||||
pl_nodejs_npm_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_nodejs);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
@ -27,7 +27,7 @@ pl_nodejs_pnpm_getsrc (char *option)
|
||||
void
|
||||
pl_nodejs_pnpm_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_nodejs);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Last Modified : <2024-08-09>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
NugetOrg = {"nuget.org", "NuGet Org", "Nuget Organization", "https://www.nuget.org/",
|
||||
{SKIP, ToFill, ToFill, NULL}
|
||||
};
|
||||
@ -19,7 +19,7 @@ NugetOrg = {"nuget.org", "NuGet Org", "Nuget Organization", "https://www.nuget.o
|
||||
* https://mirrors.huaweicloud.com/mirrorDetail/5ebf85de07b41baf6d0882ab?mirrorName=nuget&catalog=language
|
||||
* }
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_nuget_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&NugetOrg, "https://www.nuget.org/api/v2/"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2023-09-15
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_ocaml_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/git/opam-repository.git"}
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @update 2024-09-14
|
||||
* @note 缺少教育网或开源社区软件源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_php_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/composer/"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2024-05-24
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_perl_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Bfsu, "https://mirrors.bfsu.edu.cn/CPAN/"},
|
||||
|
@ -28,7 +28,7 @@ pl_python_pdm_getsrc (char *option)
|
||||
void
|
||||
pl_python_pdm_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
@ -27,7 +27,7 @@ pl_python_poetry_getsrc (char *option)
|
||||
void
|
||||
pl_python_poetry_setsrc (char *option)
|
||||
{
|
||||
SourceInfo source;
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
@ -12,7 +12,7 @@
|
||||
* @update 2024-09-14
|
||||
* @note 不要添加Zju,浙大的pypi在校外访问会自动转向Tuna
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_python_sources[] = {
|
||||
{&UpstreamProvider, "https://pypi.org/simple"},
|
||||
{&Bfsu, "https://mirrors.bfsu.edu.cn/pypi/web/simple"},
|
||||
|
@ -38,7 +38,7 @@ pl_python_pip_setsrc (char *option)
|
||||
return;
|
||||
}
|
||||
|
||||
SourceInfo source;
|
||||
Source_t source;
|
||||
chsrc_yield_for_the_source (pl_python);
|
||||
if (ProgMode_Target_Group!=true)
|
||||
chsrc_confirm_source;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* 我们在换cran的同时,也直接帮助用户换bioconductor
|
||||
* }
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_r_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/cran/"},
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Last Modified : <2024-11-21>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
RubyChina = {
|
||||
"rubychina", "RubyChina", "Ruby China 社区", "https://gems.ruby-china.com/",
|
||||
{NotSkip, NA, NA, "https://gems.ruby-china.com/rubygems/gems/nokogiri-1.15.0-java.gem"} // 9.9 MB
|
||||
@ -20,7 +20,7 @@ RubyChina = {
|
||||
*
|
||||
* @note 曾经的问题 https://ruby-china.org/topics/43331
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_ruby_sources[] = {
|
||||
{&UpstreamProvider, "https://rubygems.org"},
|
||||
{&RubyChina, "https://gems.ruby-china.com/"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
* @note 以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`
|
||||
* @note 链接末尾的 `/` 不能缺少
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_rust_cargo_sources[] = {
|
||||
{&UpstreamProvider, "https://index.crates.io/"}, // @help 是这个吗?
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/"},
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Last Modified : <2024-11-21>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
RsProxyCN = {
|
||||
"rsproxycn", "RsProxy.cn", "字节跳动基础架构Dev Infra", "https://rsproxy.cn/",
|
||||
{SKIP, ToFill, ToFill, NULL}
|
||||
|
@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @update 2024-10-02
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
pl_rust_rustup_sources[] = {
|
||||
{&UpstreamProvider, "https://static.rust-lang.org"},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/rustup"},
|
||||
|
@ -138,7 +138,7 @@ static const char
|
||||
/**
|
||||
* @sync https://github.com/RubyMetric/chsrc/wiki
|
||||
*/
|
||||
static MirrorSite*
|
||||
static MirrorSite_t*
|
||||
available_mirrors[] = {
|
||||
|
||||
/* 教育网 */
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @update 2024-11-21
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_armbian_sources[] = {
|
||||
{&UpstreamProvider, "http://apt.armbian.com"},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/armbian"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @update 2024-11-21
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_debian_sources[] = {
|
||||
{&UpstreamProvider, "http://deb.debian.org/debian"},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/debian/"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @update 2024-11-21
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_kali_sources[] = {
|
||||
{&UpstreamProvider, "http://http.kali.org/kali"},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/kali"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @update 2024-11-21
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_linuxlite_sources[] = {
|
||||
{&UpstreamProvider, "http://repo.linuxliteos.com/linuxlite/"},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/linuxliteos/"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @update 2024-11-21 更新
|
||||
* @note 实际上镜像站里的内容和Ubuntu的不太一样
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_linuxmint_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/linuxmint/"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2024-04-18
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_ros_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @time 2023-09-29 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_raspberrypi_sources[] = {
|
||||
{&UpstreamProvider, "https://archive.raspberrypi.com/"}, // https://archive.raspberrypi.org/ until Debian "bullseye" release
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/raspberrypi/"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @time 2024-11-21 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_trisquel_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/trisquel/"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @update 2024-11-21
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_ubuntu_sources[] = {
|
||||
{&UpstreamProvider, "http://archive.ubuntu.com/ubuntu/"}, //不支持https
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/ubuntu/"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @update 2024-09-14
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_deepin_sources[] = {
|
||||
{&UpstreamProvider, "https://community-packages.deepin.com/deepin"},
|
||||
{&Ali, "https://mirrors.aliyun.com/deepin"},
|
||||
|
@ -13,7 +13,7 @@
|
||||
/**
|
||||
* @time 2023-09-29 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_openkylin_sources[] = {
|
||||
{&UpstreamProvider, "https://archive.openkylin.top/openkylin/"},
|
||||
{&Ali, "https://mirrors.aliyun.com/openkylin/"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2024-09-14
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_alpine_sources[] = {
|
||||
{&UpstreamProvider, "http://dl-cdn.alpinelinux.org/alpine"},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/alpine"},
|
||||
|
@ -16,7 +16,7 @@
|
||||
* [2023-09-27] 请务必保持Nju前面有至少一个镜像,原因请查看 freebsd 的换源函数
|
||||
* }
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_freebsd_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ustc, "mirrors.ustc.edu.cn"},
|
||||
@ -41,7 +41,7 @@ os_freebsd_setsrc (char *option)
|
||||
|
||||
int index = use_specific_mirror_or_auto_select (option, os_freebsd);
|
||||
|
||||
SourceInfo source = os_freebsd_sources[index];
|
||||
Source_t source = os_freebsd_sources[index];
|
||||
chsrc_confirm_source;
|
||||
|
||||
chsrc_log2 ("1. 添加 freebsd-pkg 源 (二进制安装包)");
|
||||
|
@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @update 2024-09-14
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_netbsd_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/pkgsrc/packages/NetBSD/"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @update 2024-09-14
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_openbsd_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/OpenBSD/"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2024-09-14
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_gentoo_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "mirrors.aliyun.com"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2024-08-08
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_openwrt_sources[] = {
|
||||
{&UpstreamProvider, "http://downloads.openwrt.org"},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/openwrt"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @time 2023-09-29 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_solus_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/solus/packages/shannon/eopkg-index.xml.xz"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @time 2023-09-24 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_void_sources[] = {
|
||||
{&UpstreamProvider, "https://repo-default.voidlinux.org"},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/voidlinux"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @time 2024-06-12 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_almalinux_sources[] = {
|
||||
{&UpstreamProvider, "http://repo.almalinux.org/almalinux"},
|
||||
{&Ali, "https://mirrors.aliyun.com/almalinux"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
/**
|
||||
* @time 2024-06-12 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_anolis_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/anolis"},
|
||||
|
@ -14,7 +14,7 @@
|
||||
/**
|
||||
* @update 2024-11-04
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_fedora_sources[] = {
|
||||
{&UpstreamProvider, "http://download.example/pub/fedora/linux"},
|
||||
{&Ali, "https://mirrors.aliyun.com/fedora"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @time 2024-06-12 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_rockylinux_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/rocky"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
/**
|
||||
* @update 2024-09-14
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_openeuler_sources[] = {
|
||||
{&UpstreamProvider, "https://repo.openeuler.org/"},
|
||||
{&Ali, "https://mirrors.aliyun.com/openeuler/"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2024-08-16
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_opensuse_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/opensuse"},
|
||||
|
@ -12,7 +12,7 @@
|
||||
* @update 2024-07-03
|
||||
* @note 不要给后面加 / ,因为ARM情况下,还要额外加一个 arm 后缀
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_arch_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/archlinux"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @time 2024-04-18 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
os_msys2_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Ali, "https://mirrors.aliyun.com/msys2"},
|
||||
|
@ -33,7 +33,7 @@
|
||||
/**
|
||||
* 定义专服务于该target的镜像站,该例数据为虚拟填充
|
||||
*/
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
RubyMetric = {"rbmt", // chsrc set <target> rbmt
|
||||
"RubyMetric", // 该镜像站的缩写
|
||||
"RubyMetric.com", // 该镜像站的全名
|
||||
@ -45,7 +45,7 @@ RubyMetric = {"rbmt", // chsrc set <target> rbmt
|
||||
* @update 2024-08-09
|
||||
* @note 该target的各个源地址,该例数据为虚拟填充
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
<category>_<target>_sources[] = {
|
||||
{&UpstreamProvider, "上游地址,若维护者暂时未知,可填NULL,这个主要用于reset"},
|
||||
{&RubyMetric, "https://rubymetirc.com/target"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @time 2023-09-10 更新
|
||||
* @note 这些链接将会在setsrc函数中补充完整
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_anaconda_sources[] = {
|
||||
{&UpstreamProvider, "https://repo.anaconda.com/"},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/anaconda/"},
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @time 2024-06-08 更新
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_cocoapods_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git"},
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Last Modified : <2024-11-22>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
DaoCloud = {
|
||||
"daocloud", "DaoCloud","上海道客网络科技有限公司", "https://www.daocloud.io/",
|
||||
// 没有找到 DaoCloud 合适的下载链接,先随便给一个,以规避 chsrc 自动测速时所有 dockerhub 镜像站都没有测速链接带来的 bug
|
||||
@ -36,7 +36,7 @@ Huecker = {
|
||||
* @consult https://gist.github.com/y0ngb1n/7e8f16af3242c7815e7ca2f0833d3ea6
|
||||
*/
|
||||
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_dockerhub_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
// {&Ustc, "https://docker.mirrors.ustc.edu.cn/"},
|
||||
|
@ -7,7 +7,7 @@
|
||||
* Last Modified : <2024-11-21>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
static MirrorSite
|
||||
static MirrorSite_t
|
||||
EmacsChina = {
|
||||
"emacschina", "EmacsChina", "Emacs China 社区", "https://elpamirror.emacs-china.org/",
|
||||
{SKIP, ToFill, ToFill, NULL}
|
||||
@ -17,7 +17,7 @@ EmacsChina = {
|
||||
* @update 2023-09-10
|
||||
* @note Emacs用户往往只需要一次性换源,只会极少次调用 chsrc,我们只给用户提供文档
|
||||
*/
|
||||
SourceInfo
|
||||
Source_t
|
||||
wr_emacs_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/docs/emacs-elpa"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @update 2023-09-11
|
||||
* @note 目前只有一个源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_flathub_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/flathub"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @update 2023-09-11
|
||||
* @note 目前只有一个源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_guix_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn/git/guix.git"}
|
||||
|
@ -15,7 +15,7 @@
|
||||
* 2. 不确定 Sustech 能否工作
|
||||
* }
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_homebrew_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/"},
|
||||
|
@ -14,7 +14,7 @@
|
||||
* 2. 这些链接将会在setsrc函数中补充完整
|
||||
* }
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_nix_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Bfsu, "https://mirrors.bfsu.edu.cn/nix-channels/"}
|
||||
|
@ -10,7 +10,7 @@
|
||||
/**
|
||||
* @update 2023-09-10
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_tex_sources[] = {
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/ctan/systems/texlive/tlnet"},
|
||||
|
@ -11,7 +11,7 @@
|
||||
* @update 2024-06-07
|
||||
* @note 目前仅有一个源
|
||||
*/
|
||||
static SourceInfo
|
||||
static Source_t
|
||||
wr_winget_sources[] = {
|
||||
{&UpstreamProvider, "https://cdn.winget.microsoft.com/cache"},
|
||||
{&Ustc, "https://mirrors.ustc.edu.cn/winget-source"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user