Skip to content

Commit d61de4f

Browse files
committed
uv修复镜像站测速链接404
删除阿里镜像
1 parent 3a32337 commit d61de4f

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

  • src/recipe/lang/Python

‎src/recipe/lang/Python/uv.c‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pl_uv_github_release_prelude (void)
156156

157157
chef_set_recipe_created_on (this, "2026-05-31");
158158
chef_set_recipe_last_updated (this, "2026-05-31");
159-
chef_set_sources_last_updated (this, "2026-05-31");
159+
chef_set_sources_last_updated (this, "2026-06-01");
160160

161161
chef_set_chef (this, NULL);
162162
chef_set_cooks (this, 1, "@Mikachu2333");
@@ -169,14 +169,12 @@ pl_uv_github_release_prelude (void)
169169
{&UpstreamProvider, "https://github.com/astral-sh/python-build-standalone/releases/download", DelegateToUpstream},
170170
{&Nju, "https://mirrors.nju.edu.cn/github-release/astral-sh/python-build-standalone", FeedByPrelude},
171171
{&Ustc, "https://mirrors.ustc.edu.cn/github-release/astral-sh/python-build-standalone", FeedByPrelude},
172-
{&Lzuoss, "https://mirror.lzu.edu.cn/github-release/astral-sh/python-build-standalone", FeedByPrelude},
173-
{&Ali, "https://mirrors.aliyun.com/github/releases/astral-sh/python-build-standalone", FeedByPrelude}
172+
{&Lzuoss, "https://mirror.lzu.edu.cn/github-release/astral-sh/python-build-standalone", FeedByPrelude}
174173
def_sources_end ()
175174

176175
#define GH_SM_POSTFIX "/20260510/cpython-3.14.5+20260510-i686-pc-windows-msvc-install_only_stripped.tar.gz"
177176
chef_set_smURL_with_postfix (this, &Nju, GH_SM_POSTFIX);
178177
chef_set_smURL_with_postfix (this, &Lzuoss, GH_SM_POSTFIX);
179-
chef_set_smURL_with_postfix (this, &Ali, GH_SM_POSTFIX);
180178
#undef GH_SM_POSTFIX
181179

182180
/* 2026-5-31: USTC 仅保留 Latest, 只能用 SHA256SUMS 粗略测速 */
@@ -412,8 +410,21 @@ pl_python_uv_setsrc (char *option)
412410
}
413411

414412
/* set: 选取源并写入 */
415-
Source_t source = chsrc_yield_source (&pl_python_group_target, option);
416-
Source_t gh_source = chsrc_yield_source (&pl_uv_github_release_target, NULL);
413+
Source_t source = chsrc_yield_source (&pl_python_group_target, option);
414+
415+
/* 若 option 命中了 GitHub release 源则直接用, 否则自动测速 */
416+
char *gh_opt = option;
417+
if (gh_opt && !chsrc_in_reset_mode () && !hp_is_url (gh_opt))
418+
{
419+
bool found = false;
420+
if (!pl_uv_github_release_target.inited)
421+
pl_uv_github_release_target.preludefn ();
422+
for (int i = 0; i < pl_uv_github_release_target.sources_n; i++)
423+
if (xy_streql (pl_uv_github_release_target.sources[i].mirror->code, gh_opt))
424+
{ found = true; break; }
425+
if (!found) gh_opt = NULL;
426+
}
427+
Source_t gh_source = chsrc_yield_source (&pl_uv_github_release_target, gh_opt);
417428

418429
if (chsrc_in_standalone_mode())
419430
chsrc_confirm_source (&source);

0 commit comments

Comments
 (0)