Skip to content

Commit

Permalink
Update 0012-changelog-specification.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeno-sole committed Aug 26, 2024
1 parent c74a1e8 commit 23dcc75
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion rfcs/0012-changelog-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ native软件包没有-的连字符,因此直接在上游版本号后添加+dee

- 对于相同版本软件包需要在两个以上的版本中做安全更新(例如 v23 and v26)时,为确保版本号正确,必须大于当前软包版本且小于后续发行版中的软件包版本,请示在版本号后缀中添加+dp${version}u${num}形式
- 对于v23版本 `upstreamversion-${ver1}deepin${ver2}+dp23u1` 对于v26版本 `upstreamversion-${ver1}deepin${ver2}+dp26u1` ,对于首次更新${ver2}值应当增加假设{ver2}为1 更新后应该为1.1此举是为了区别于主线版本号避免影响主线上的rebuild版本机制,对于主线的安全更新版本{ver2}加1即可, 对于后续的更新,$num值都应当累加,由于版本号形式较多建议使用 `dpkg --compare-versions` 验证版本号是否符合要求。
- 参考的形式 原版本 `upstreamversion-1deepin1` 安全更新版本 `upstreamversion-1deepin1.1+dp23u1`
- 参考的形式 原版本 `upstreamversion-1deepin1` 安全更新版本 `upstreamversion-1deepin1.1+dp23u1`
- 当deepin${ver2} 不存在时,此时安全更新的ver2版本应该使用0.1 主线版本使用1 避免与主线版本冲突, 参考的形式`upstreamversion-1deepin0.1+dp23u1`
- 对于非上述情况时应当遵循上文的版本号规范提交。
> [!TIP]
> 注: dp为deepin的缩写
Expand All @@ -70,6 +71,62 @@ native软件包没有-的连字符,因此直接在上游版本号后添加+dee

#### 7. 总结
##### BNF规则
```
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
<nonzero_digit> ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
<digit_sequence> ::= <digit> | <digit> <digit_sequence>
/* >= 1 */
<positive_integer> ::= <nonzero_digit> | <nonzero_digit> <digit_sequence>
/* This coresponds to the "upstream‐version" field in deb-version(7) */
<UPSTREAM_VERSION> ::= "1.0.0"
/* This coresponds to the "[epoch:]" field in deb-version(7) */
<EPOCH> ::= E | <positive_integer> ":"
/* This coresponds to the "debian‐revision" field in deb-version(7) */
<DEBIAN_REVISION> ::= <positive_integer>
/* ${ver1}deepin${ver2}, ver2 is incremental */
/* 0deepinY: Y >= 1 */
/* XdeepinY: Y=0 means rebuild, Y>1 means patching */
<DEEPIN_REVISION> ::= "0deepin" <positive_integer> | <DEBIAN_REVISION> "deepin" [0-9]+
<VER_MAINLINE_GITHUB_DEBIAN> ::= <EPOCH> <UPSTREAM_VERSION> "-" <DEBIAN_REVISION>
<VER_MAINLINE_GITHUB_DEEPIN> ::= <EPOCH> <UPSTREAM_VERSION> "-" <DEEPIN_REVISION>
<VER_MAINLINE_GITHUB> ::= <VER_MAINLINE_GITHUB_DEBIAN> | <VER_MAINLINE_GITHUB_DEEPIN>
<REBUILD_TAG> ::= E | "+rb" <positive_integer>
/* We don't allow REBUILD_TAG after VER_MAINLINE_GITHUB_DEBIAN */
<VER_MAINLINE_REPO> ::= <VER_MAINLINE_GITHUB_DEBIAN> | <VER_MAINLINE_GITHUB_DEEPIN> <REBUILD_TAG>
/* Definition of CI version */
<CI_REVISION> ::= [0-9] [0-9] [0-9]
<CI_TAG> ::= E | "+u" <CI_REVISION>
<VER_CI> ::= <VER_MAINLINE_GITHUB> <CI_TAG>
/* Definition of Security version */
<VER_DEEPIN_MAJOR> ::= "23" | "25"
<SECURITY_TAG> ::= "+dp" <VER_DEEPIN_MAJOR> "u" <positive_integer>
/* SECURITY_SUFFIX is used to override ver2 when needed */
/* See: https://github.com/deepin-community/rfcs/pull/12/#discussion_r1721540877 */
/* if mainline is 1.0.0-1, the security version should be 1.0.0-1deepin0.1+dp23u1 */
/* if mainline is 1.0.0-1deepin0, the security version should be 1.0.0-1deepin1.1+dp23u1 too */
/* if mainline is 1.0.0-1deepinY (Y>1), the security version should be 1.0.0-1deepinY.1+dp23u1 */
<SECURITY_VER2_SUFFIX> ::= E | "." <positive_integer>
<VER_SECURITY_GITHUB> ::= <VER_MAINLINE_GITHUB_DEEPIN> <SECURITY_VER2_SUFFIX> <SECURITY_TAG>
<VER_SECURITY_REPO> ::= <VER_SECURITY_GITHUB> <REBUILD_TAG>
```

附带一个 BNF Playground: https://bnfplayground.pauliankline.com/

> [!TIP]
> 可参考BNF验证自己写的版本号是否符合规范
##### 完整的构造
`upstreamversion-${ver1}deepin${ver2}[+dp26u${num}][+u${ver3}][+rb${ver4}]`
Expand Down

0 comments on commit 23dcc75

Please sign in to comment.