diff --git a/src/framework/core.c b/src/framework/core.c index 2ccb9d4..097cb92 100644 --- a/src/framework/core.c +++ b/src/framework/core.c @@ -579,17 +579,6 @@ get_max_ele_idx_in_dbl_ary (double *array, int size) } -/** - * 默认上游源时不测速的,该函数改变该行为,测速上游源 - */ -void -chsrc_set_measure_upstream (char *url) -{ - SpeedMeasureInfo_t *upsmi = &UpstreamProvider.smi; - upsmi->skip = NotSkip; - upsmi->url = url; -} - /** * @param sources 所有待测源 * @param size 待测源的数量 diff --git a/src/recipe/os/APT/Ubuntu.c b/src/recipe/os/APT/Ubuntu.c index cf8a242..c784dfb 100644 --- a/src/recipe/os/APT/Ubuntu.c +++ b/src/recipe/os/APT/Ubuntu.c @@ -9,11 +9,18 @@ * Last Modified : <2024-11-22> * ------------------------------------------------------------*/ +static SourceProvider_t UpstreamUbuntu = +{ + "upstream", "archive.ubuntu.com", "上游默认源 archive.ubuntu.com", "http://archive.ubuntu.com/", + // https://github.com/RubyMetric/chsrc/issues/121 + {NotSkip, NA, NA, "http://archive.ubuntu.com/ubuntu/dists/noble/Contents-amd64.gz"} +}; + /** * @update 2024-11-21 */ -static Source_t -os_ubuntu_sources[] = { +static Source_t os_ubuntu_sources[] = +{ {&UpstreamProvider, "http://archive.ubuntu.com/ubuntu/"}, //不支持https {&MirrorZ, "https://mirrors.cernet.edu.cn/ubuntu/"}, {&Ali, "https://mirrors.aliyun.com/ubuntu"}, @@ -88,9 +95,6 @@ os_ubuntu_setsrc (char *option) { chsrc_ensure_root (); - // https://github.com/RubyMetric/chsrc/issues/121 - chsrc_set_measure_upstream ("http://archive.ubuntu.com/ubuntu/dists/noble/Contents-amd64.gz"); - if (chsrc_check_file (OS_Ubuntu_SourceList_DEB822)) { char *msg = CliOpt_InEnglish ? "Will change source based on new format"