chore(license): 补 Apache License 2.0

许可证正文**逐字采用** ASF 的 LICENSE-2.0.txt,只把 APPENDIX 里的版权占位行填成
"Copyright 2026 Shuery" —— 正文一个字节都没改。

为此先下载规范文本再打补丁,而不是凭记忆抄一遍:许可证抄错一个词就不再是那个许可证了。
校验方式是逐行对比本仓 LICENSE 与规范文本,结果只差版权那一行(规范文本 11358 字节、
SHA256 cfc7749b…;本仓 11337 字节,差额 21 字节正好等于两行文本的长度差)。

选 Apache-2.0 而非 MIT,主要差别在第 3 节的**明示专利授权**:贡献者授予专利许可,
而不只是版权许可。

同时:
  * README 的许可证章节从「尚未声明」改成实际条款摘要 + 徽章(License: Apache-2.0)
  * BakNRet.psd1 的 PrivateData.PSData 登记 LicenseUri 与 Copyright,Import-Module
    之后可直接读到许可信息
  * 不加 NOTICE:第 4(d) 节只在作品本身带 NOTICE 时才要求向下传递,而本仓库不分发第三方
    代码(Pester / PSScriptAnalyzer 只放在 .tools/ 供本地测试,既进 gitignore 也不进分发产物)
  * .scratch/ci-cd 的两份报告补了带日期的「后续更新」注记,关掉许可证合规的 L-1 与依赖
    安全扫描的 R-1,避免后来的人读到「主许可证未声明」这个已经过期的结论

验收:test.ps1 9/9 全绿(5.1 与 7);静态分析 80 条、0 Error(与改动前持平);
README 相对链接 0 失效、新增外部链接 2/2 返回 200;双宿主解析 psd1 零错、89 个导出不变。
This commit is contained in:
Shuery committed 2026-10-02 01:34:45 +08:00
1 parent 45bbd66815
commit 2cbcaaee48
5 files changed
+253 -7

No files matched your search

+31 -4
View File
@@ -15,7 +15,7 @@
[![Public functions: 89](https://img.shields.io/badge/%E5%AF%B9%E5%A4%96%E5%87%BD%E6%95%B0-89-blue)](#-架构)
[![Pester: 183 passed](https://img.shields.io/badge/Pester-183%20passed-success)](#-测试)
[![Encoding: UTF--8 with BOM](https://img.shields.io/badge/Encoding-UTF--8%20with%20BOM-orange)](#-编码与风格)
[![License: none](https://img.shields.io/badge/License-none%20yet-lightgrey)](#-许可证)
[![License: Apache--2.0](https://img.shields.io/badge/License-Apache%202.0-blue)](./LICENSE)
## ✨ 为什么是它
@@ -909,10 +909,37 @@ BakNRet/
## 📄 许可证
<!-- TODO: 补充 -->
本项目以 **Apache License 2.0** 发布,完整条款见 [LICENSE](./LICENSE)。
该文件**逐字采用** ASF 的 [LICENSE-2.0.txt](https://www.apache.org/licenses/LICENSE-2.0.txt),
只把 APPENDIX 里的版权占位行填成了实际的版权声明 —— 许可证正文一个字节都没改。
本仓库目前**没有 `LICENSE` 文件**,因此尚未声明开源许可证 —— 按默认著作权保留处理。
如果打算公开分发,请补一份许可证(例如 MIT / Apache-2.0)并在这里指向它。
```text
Copyright 2026 Shuery
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
要点:
- **宽松许可**:允许商用、修改、再分发,也允许闭源衍生 —— 与 MIT 同属宽松阵营。
- **要保留声明**:必须保留版权与许可声明,并对修改过的文件作出醒目说明(第 4(b)(c) 节)。
- **含明示的专利授权**(第 3 节):这是 Apache-2.0 相对 MIT 的主要差别 —— 贡献者授予专利许可,
而不是只给版权许可。
- **没有 `NOTICE` 文件**:第 4(d) 节只在作品本身带 `NOTICE` 时才要求向下传递。本仓库不分发
第三方代码(Pester 与 PSScriptAnalyzer 只放在 `.tools/` 供本地测试,既进 `.gitignore`、
也不进分发产物),因此无需 `NOTICE`。
- 模块清单 `BakNRet/BakNRet.psd1` 的 `PrivateData.PSData` 里也登记了 `LicenseUri` 与
`Copyright`,便于 `Import-Module` 之后直接读到许可信息。
## 🙏 致谢