fix: 排除规则漏了根目录的 EE 许可证引用文件;脚本补 public 方向修正
修一个会误导读者的排除漏洞: 只排除 ee/ 时,LICENSES/LicenseRef-OpenWork-EE.txt 仍会被推进镜像。 它是 REUSE 规范的引用文件,存在的唯一意义是给 ee/ 下的文件做 SPDX 引用 (ee/ 里写着 "SPDX-License-Identifier: LicenseRef-OpenWork-EE")。 ee/ 一删,它就成了孤儿。许可证文本公開本身不侵权(上游自己就公开), 但一个不含 EE 代码的仓库里躺着 EE 许可证,读者只会以为我们漏排了。 许可证块补 redistributable_after_excludes: true。 依据:根 LICENSE 原文(已读远端全文)—— "All content that resides under the /ee directory ... OpenWork EE License" "Content outside ... is available under the 'MIT' license" 排除 ee/ 后为纯 MIT。 mirror_sync.sh 补 private → public 方向修正,但默认不自动翻: 原先脚本只有「收紧」方向(应为私有就 PATCH private:true), 没有放宽方向——openwork 判定为 public 但仓库停在 private, 重跑多少次都不会翻过来,档案与事实不一致却看不出原因。 现在会报告「应为 public 但当前 private」,要求显式加 --set-public。 公开不可逆,放松方向永远不该自动做。 一句话结论去掉样本计数: maka「四个里唯一」、QwenPaw/Tutti「七个里…」——每加一批样本就过时一次。 改成不带计数的表述,「已收录样本中」本就是隐含的。 总纲 id=98 已重发。
This commit is contained in:
@@ -361,6 +361,31 @@ def quadrant_svg(items: list[dict]) -> str:
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- 主流程
|
||||
# sync_note 是手写备注,mode / last_sync 是脚本回写的事实。
|
||||
# 两者会漂移:镜像跑完之后 mode 变成了 source-only,note 里还写着「尚未执行,待带宽窗口」。
|
||||
# 档案里出现和事实相反的话,比没有备注更糟——读者会照着错的那个信。
|
||||
STALE_PHRASES = ("尚未执行", "暂未镜像", "待带宽", "尚未镜像", "未镜像")
|
||||
|
||||
|
||||
def check_mirror_notes(items: list[dict]) -> None:
|
||||
"""mirror 块已跑完(mode 非 pending/空)却还写着「尚未执行」→ 提示改。"""
|
||||
bad = []
|
||||
for d in items:
|
||||
m = d.get("mirror") or {}
|
||||
mode = str(m.get("mode") or "").strip()
|
||||
if mode in ("", "pending", "link-only"):
|
||||
continue # 没跑过 / 明确不镜像,note 说「待执行」是对的
|
||||
note = str(m.get("sync_note") or "")
|
||||
hit = [p for p in STALE_PHRASES if p in note]
|
||||
if hit:
|
||||
bad.append((d.get("id") or d.get("name"), mode, "/".join(hit)))
|
||||
if not bad:
|
||||
return
|
||||
print(f" [warn] {len(bad)} 个档案的 mirror.sync_note 与实际状态矛盾:")
|
||||
for aid, mode, hit in bad:
|
||||
print(f" - {aid}:mode={mode},但 note 里仍有「{hit}」")
|
||||
|
||||
|
||||
def main() -> int:
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--stdout", action="store_true", help="只打印不写文件")
|
||||
@@ -373,6 +398,8 @@ def main() -> int:
|
||||
|
||||
print(f"==> 载入 {len(items)} 个项目:{', '.join(d.get('name','') for d in items)}")
|
||||
|
||||
check_mirror_notes(items)
|
||||
|
||||
matrix = build_tables(items)
|
||||
chart = quadrant_svg(items) if len(items) >= QUAD_THRESHOLD else stack_diagram(items)
|
||||
block = f"{BEGIN}\n{matrix}\n\n{chart}\n{END}"
|
||||
|
||||
Reference in New Issue
Block a user