From abb68003d26bb506dd5bee90ca8c13d5ab172de4 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Tue, 18 Nov 2025 13:47:10 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=94=9F=E6=88=90=E8=A1=A5=E4=B8=81?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=8E=BB=E9=99=A4=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E5=8C=85=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patch_generator.sh | 61 +--------------------------------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/patch_generator.sh b/patch_generator.sh index 6f3ccf7..3e15379 100644 --- a/patch_generator.sh +++ b/patch_generator.sh @@ -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() { @@ -972,10 +916,7 @@ generate_patch() { # 签名补丁包 sign_package "$output_path" - - # 生成回滚包 - generate_rollback_package "$source_dir" "$changes_file" "$output_path" - + send_notification "success" "补丁包生成成功" "$output_path" return 0 else