Skip to content

Commit 92b5e22

Browse files
committed
CI: check-depend-all: disable process show for ci
deepin inclusion category: other Also remove schedule everyday, if we need we can bring it back. Signed-off-by: Wentao Guan <guanwentao@uniontech.com> (cherry picked from commit 9f06030) Signed-off-by: Wentao Guan <guanwentao@uniontech.com> (cherry picked from commit 8f3056c) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent f65adfd commit 92b5e22

2 files changed

Lines changed: 24 additions & 31 deletions

File tree

.github/tools/check_kernel_commits.sh

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ log_error() { echo -e "\033[31m[ERROR]\033[0m $*" >&2; }
1111

1212
main() {
1313
[ $# -lt 1 ] && { echo "Usage: $0 <range> [branch]" >&2; exit 1; }
14-
14+
1515
local range="$1"
16-
16+
1717
if ! git remote get-url torvalds >/dev/null 2>&1; then
1818
git remote add torvalds "${REMOTE_URL}"
1919
else
@@ -26,20 +26,20 @@ main() {
2626
log_error "目标分支不存在: $TARGET_BRANCH"
2727
exit 1
2828
fi
29-
29+
3030
local tmp_target=$(mktemp)
31-
31+
3232
log_info "正在导出 $TARGET_BRANCH 标题..."
3333
git log --format="%s" "$TARGET_BRANCH" 2>/dev/null > "$tmp_target"
3434
local target_count=$(wc -l < "$tmp_target")
3535
log_info "目标分支共 $target_count 个标题"
36-
36+
3737
local total=$(git rev-list --count "$range" 2>/dev/null || echo "0")
3838
log_info "检查范围 $range (共 $total 个提交)..."
39-
39+
4040
log_info "开始筛选..."
4141
echo "========================================"
42-
42+
4343
# 使用标准AWK(兼容mawk/gawk),避免match()数组捕获
4444
git log --format="%H%n%s%n%b%n---COMMIT_END---" --reverse "$range" 2>/dev/null | \
4545
awk -v target_file="$tmp_target" -v total="$total" '
@@ -49,52 +49,48 @@ main() {
4949
if (length(line) > 0) target[line] = 1
5050
}
5151
close(target_file)
52-
52+
5353
matched = 0
5454
dup = 0
5555
no_fixes = 0
5656
no_ref = 0
5757
processed = 0
58-
58+
5959
# 读取状态:0=读hash, 1=读subject, 2=读body
6060
state = 0
6161
}
62-
62+
6363
/---COMMIT_END---/ {
6464
# 处理完一个commit
6565
if (hash != "") {
6666
processed++
67-
if (processed % 10 == 0) {
68-
printf "\r[INFO] 进度: %d/%d | 匹配:%d 重复:%d 无Fixes:%d 缺依赖:%d",
69-
processed, total, matched, dup, no_fixes, no_ref > "/dev/stderr"
70-
}
71-
67+
7268
# 条件1:标题是否已存在?
7369
if (subject in target) {
7470
dup++
7571
} else {
7672
# 条件2:查找 Fixes: 行
7773
has_fixes = 0
7874
ref_found = 0
79-
75+
8076
# 分割body行查找 Fixes:
8177
n = split(body, lines, /\n/)
8278
for (i=1; i<=n; i++) {
8379
if (lines[i] ~ /^Fixes:/) {
8480
has_fixes = 1
85-
81+
8682
# 提取 ("...") 中的内容(兼容所有awk版本)
8783
line_content = lines[i]
8884
start_pos = index(line_content, "(\"")
89-
85+
9086
if (start_pos > 0) {
9187
# 找到 (" 的位置,提取到 ") 结束
9288
temp = substr(line_content, start_pos + 2)
9389
end_pos = index(temp, "\")")
94-
90+
9591
if (end_pos > 0) {
9692
ref_title = substr(temp, 1, end_pos - 1)
97-
93+
9894
# 检查引用是否在目标分支
9995
if (ref_title in target) {
10096
ref_found = 1
@@ -104,54 +100,53 @@ main() {
104100
}
105101
}
106102
}
107-
103+
108104
if (!has_fixes) {
109105
no_fixes++
110106
} else if (!ref_found) {
111107
no_ref++
112108
} else {
113109
# 符合条件:有Fixes且引用存在,且标题不重复
114110
matched++
115-
printf "\r\033[K" > "/dev/stderr" # 清行
116111
print hash " " subject
117112
}
118113
}
119114
}
120-
115+
121116
state = 0
122117
hash = ""
123118
subject = ""
124119
body = ""
125120
next
126121
}
127-
122+
128123
state == 0 {
129124
hash = $0
130125
state = 1
131126
next
132127
}
133-
128+
134129
state == 1 {
135130
subject = $0
136131
state = 2
137132
next
138133
}
139-
134+
140135
state == 2 {
141136
# 累积body行
142137
if (body == "") body = $0
143138
else body = body "\n" $0
144139
next
145140
}
146-
141+
147142
END {
148143
printf "\r\033[K" > "/dev/stderr"
149144
print "[INFO] 完成: 总计 " processed " | 匹配 " matched " | 重复 " dup " | 无Fixes " no_fixes " | 缺依赖 " no_ref > "/dev/stderr"
150145
}
151146
'
152-
147+
153148
echo "========================================" >&2
154-
149+
155150
rm -f "$tmp_target"
156151
}
157152

.github/workflows/check-depend-all.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: check depend all
22
on:
33
pull_request:
44
workflow_dispatch:
5-
schedule:
6-
- cron: "0 2 * * *"
75

86
env:
97
KBUILD_BUILD_USER: deepin-kernel-sig

0 commit comments

Comments
 (0)