From 7a64072641b0a0672ea30d2778409a8f3129fce9 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sat, 5 Dec 2026 11:17:42 +0900 Subject: [PATCH 1/3] cmdline 0.3.0 and xpkg 0.0.68 have their CN mirror (gitcode mcpp-res) The two archives are on gitcode mcpp-res with the same bytes as the GitHub archives (sha256 checked by download), so the plain-string urls become { GLOBAL, CN } tables. Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --- pkgs/c/cmdline.lua | 6 ++++-- pkgs/x/xpkg.lua | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/c/cmdline.lua b/pkgs/c/cmdline.lua index 3e2b0613..d11195b6 100644 --- a/pkgs/c/cmdline.lua +++ b/pkgs/c/cmdline.lua @@ -87,8 +87,10 @@ package = { sha256 = "2b84d9681e392243be42d20340d0cc3fc7fcf7f3a153260136f52c12054a7e7b", }, ["0.3.0"] = { - -- No CN mirror yet: a plain-string url (see docs/cn-mirror.md). - url = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.3.0.tar.gz", + url = { + GLOBAL = "https://github.com/mcpplibs/cmdline/archive/refs/tags/v0.3.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.3.0/cmdline-0.3.0.tar.gz", + }, sha256 = "b30026156e321b15720d8f1deaa7310ed83dbfbe0cbbc4b3ad15368fd8a9fc42", }, }, diff --git a/pkgs/x/xpkg.lua b/pkgs/x/xpkg.lua index d37cac49..0235bb56 100644 --- a/pkgs/x/xpkg.lua +++ b/pkgs/x/xpkg.lua @@ -19,8 +19,10 @@ package = { xpm = { linux = { ["0.0.68"] = { - -- No CN mirror yet: a plain-string url (see docs/cn-mirror.md). - url = "https://github.com/openxlings/libxpkg/archive/refs/tags/0.0.68.tar.gz", + url = { + GLOBAL = "https://github.com/openxlings/libxpkg/archive/refs/tags/0.0.68.tar.gz", + CN = "https://gitcode.com/mcpp-res/xpkg/releases/download/0.0.68/xpkg-0.0.68.tar.gz", + }, sha256 = "c069ff9ab280d42a8edbe00b4d9f1a7f3377d6d9bbf781e00efa52ddb4e7861d", }, ["0.0.61"] = { From 30dd2acb78b24acdcc30fcc3ab0b77bc7ee10804 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sat, 5 Dec 2026 11:27:57 +0900 Subject: [PATCH 2/3] cmdline 0.3.0 and xpkg 0.0.68: revision 1 for the CN mirror The replace-payload protocol the earlier CN batches follow (#948-#950): an existing version whose url changes carries an advancing revision with its numbered comment, so the guard reads the change as made on purpose. The payload is the same bytes, the sha256 unchanged. Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --- pkgs/c/cmdline.lua | 2 ++ pkgs/x/xpkg.lua | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkgs/c/cmdline.lua b/pkgs/c/cmdline.lua index d11195b6..32b00be7 100644 --- a/pkgs/c/cmdline.lua +++ b/pkgs/c/cmdline.lua @@ -92,6 +92,8 @@ package = { CN = "https://gitcode.com/mcpp-res/cmdline/releases/download/0.3.0/cmdline-0.3.0.tar.gz", }, sha256 = "b30026156e321b15720d8f1deaa7310ed83dbfbe0cbbc4b3ad15368fd8a9fc42", + -- 1: added CN mirror (gitcode mcpp-res); payload byte-identical, sha256 unchanged. + revision = 1, }, }, macosx = { ref = "linux" }, diff --git a/pkgs/x/xpkg.lua b/pkgs/x/xpkg.lua index 0235bb56..0d16c2ca 100644 --- a/pkgs/x/xpkg.lua +++ b/pkgs/x/xpkg.lua @@ -24,6 +24,8 @@ package = { CN = "https://gitcode.com/mcpp-res/xpkg/releases/download/0.0.68/xpkg-0.0.68.tar.gz", }, sha256 = "c069ff9ab280d42a8edbe00b4d9f1a7f3377d6d9bbf781e00efa52ddb4e7861d", + -- 1: added CN mirror (gitcode mcpp-res); payload byte-identical, sha256 unchanged. + revision = 1, }, ["0.0.61"] = { url = { From 3598905b18b023e90e4b4fe7cc1d2b5b882e7fcd Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sat, 5 Dec 2026 11:28:23 +0900 Subject: [PATCH 3/3] docs(cn-mirror): a CN table added to a published version takes the next revision Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --- docs/cn-mirror.md | 4 +++- docs/zh/cn-mirror.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/cn-mirror.md b/docs/cn-mirror.md index 13c28d9c..e683d2d3 100644 --- a/docs/cn-mirror.md +++ b/docs/cn-mirror.md @@ -36,7 +36,9 @@ fallback is a plain-string url (upstream release only) — lint imposes no mirro - Existing precedent: `pkgs/t/tensorvia-cpu.lua` (a user's own mcpp library, no CN mirror, a single upstream string url on all three platforms). - Later, once access is granted or a maintainer supplies the mirror, that version's `url` can be rewritten into a - `{ GLOBAL=…, CN=… }` table (the sha256 stays the same). + `{ GLOBAL=…, CN=… }` table (the sha256 stays the same). The version entry then takes the next `revision` with a + numbered comment (`-- 1: added CN mirror (gitcode mcpp-res); payload byte-identical, sha256 unchanged.`): the + update guard refuses a published version whose url changes without one. If you need to express "GLOBAL and CN both point at upstream", use the single-string form above rather than a `{ GLOBAL=x, CN=x }` table (which cannot pass the "CN must point at gitcode" lint check). diff --git a/docs/zh/cn-mirror.md b/docs/zh/cn-mirror.md index 3758826b..2a1fed05 100644 --- a/docs/zh/cn-mirror.md +++ b/docs/zh/cn-mirror.md @@ -32,7 +32,7 @@ lint 对纯字符串 url 不施加镜像约束: - CN 用户将回退至上游源,访问较慢但功能不受影响。 - 既有先例:`pkgs/t/tensorvia-cpu.lua`(用户自有 mcpp 库,无 CN 镜像,三平台均使用上游单一字符串 url)。 -- 后续在获得权限、或由维护者补充镜像后,可将该版本的 `url` 改写为 `{ GLOBAL=…, CN=… }` 表(sha256 保持不变)。 +- 后续在获得权限、或由维护者补充镜像后,可将该版本的 `url` 改写为 `{ GLOBAL=…, CN=… }` 表(sha256 保持不变)。该版本条目同时取下一个 `revision` 并附编号注释(`-- 1: added CN mirror (gitcode mcpp-res); payload byte-identical, sha256 unchanged.`):已发布版本的 url 改变而不带 revision,更新守卫会拒绝。 如需表达“GLOBAL 与 CN 均指向上游”,应采用上述单一字符串写法,而不应写成 `{ GLOBAL=x, CN=x }` 表(其无法通过 “CN 必须指向 gitcode”的 lint 检查)。