chore: 生成补丁脚本,去除生成回滚包代码

This commit is contained in:
2025-11-18 13:47:10 +08:00
parent 87c05d684d
commit abb68003d2

View File

@@ -725,62 +725,6 @@ generate_checksum() {
fi
}
# 生成回滚包
generate_rollback_package() {
if [[ "$ROLLBACK_ENABLED" != "true" ]]; then
info "回滚包生成已禁用"
return 0
fi
local source_dir="$1"
local changes_file="$2"
local patch_path="$3"
info "开始生成回滚包"
local rollback_dir="$TEMP_DIR/rollback_content"
mkdir -p "$rollback_dir"
local rollback_files=()
# 收集需要回滚的文件
while IFS='|' read -r change_type path extra_info; do
case "$change_type" in
"MODIFIED"|"DELETED")
local source_file="$source_dir/$path"
if [[ -f "$source_file" ]]; then
local dest_file="$rollback_dir/$path"
local dest_dir=$(dirname "$dest_file")
mkdir -p "$dest_dir"
if handle_long_path_copy "$source_file" "$dest_file"; then
rollback_files+=("$path")
trace "回滚文件: $source_file"
else
warn "无法复制回滚文件: $source_file"
fi
fi
;;
esac
done < "$changes_file"
if [[ ${#rollback_files[@]} -eq 0 ]]; then
warn "没有需要回滚的文件"
return 0
fi
# 创建回滚包
local rollback_path="${patch_path%.*}.rollback.${patch_path##*.}"
if create_patch_package "$rollback_dir" "$rollback_path"; then
local size=$(du -h "$rollback_path" | cut -f1)
info "✅ 回滚包生成完成: $rollback_path ($size)"
echo "$rollback_path"
return 0
else
error "❌ 回滚包生成失败"
return 1
fi
}
# 通知系统
send_notification() {
@@ -973,9 +917,6 @@ generate_patch() {
# 签名补丁包
sign_package "$output_path"
# 生成回滚包
generate_rollback_package "$source_dir" "$changes_file" "$output_path"
send_notification "success" "补丁包生成成功" "$output_path"
return 0
else