Skip to content

fix: match new 7-Zip "Cannot" output for missing volume - #489

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:agent/pms-bug-bot/caeec6bf4368
Sep 14, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:agent/pms-bug-bot/caeec6bf4368

Conversation

@LiHua000

@LiHua000 LiHua000 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor
  1. Root cause: readListLine() hardcoded "Can not" (two words) from old p7zip; new 7-Zip 26.02 outputs "Cannot" (one word), so the check failed and the corrupt-archive dialog appeared instead of a direct error
  2. Fix: add a parallel startsWith branch for "Cannot" while keeping the original "Can not" match, so both old p7zip and new 7-Zip are handled
  3. Impact: only the missing-volume error detection in readListLine() changes; existing behavior for old p7zip is preserved

Log: fix missing-volume detection to support new 7-Zip 26.02 output

Influence:

  1. Test opening a 7z split archive with a missing volume using new 7-Zip 26.02 — should show "damaged" error directly
  2. Test the same scenario with old p7zip 16.02 — behavior unchanged
  3. Test opening a normal complete 7z archive — no regression

fix: 兼容新版7-Zip分卷缺失时的"Cannot"输出

  1. 根因:readListLine() 硬编码旧版 p7zip 输出的 "Can not"(两个单词), 新版 7-Zip 26.02 改为 "Cannot"(一个单词),匹配失败后走了 corrupt 对话框路径而非直接报错
  2. 方案:追加 "Cannot" 的 startsWith 匹配分支,保留原有 "Can not" 匹配, 兼容旧版 p7zip 与新版 7-Zip
  3. 影响:仅 readListLine() 中分卷缺失错误检测逻辑变化,旧版 p7zip 行为 保持不变

Log: 修复分卷缺失检测以支持新版7-Zip 26.02输出

Influence:

  1. 使用新版 7-Zip 26.02 打开分卷缺失的 7z 压缩包,验证直接提示"损坏"
  2. 使用旧版 p7zip 16.02 打开分卷缺失的 7z 压缩包,验证行为不变
  3. 正常打开完整的 7z 压缩包,验证无回归

PMS: BUG-376699

Summary by Sourcery

Bug Fixes:

  • Fix missing-volume detection for 7z archives by recognizing the updated “Cannot” error output from newer 7-Zip versions while preserving support for older p7zip output.

1. Root cause: readListLine() hardcoded "Can not" (two words) from old
   p7zip; new 7-Zip 26.02 outputs "Cannot" (one word), so the check
   failed and the corrupt-archive dialog appeared instead of a direct
   error
2. Fix: add a parallel startsWith branch for "Cannot" while keeping the
   original "Can not" match, so both old p7zip and new 7-Zip are handled
3. Impact: only the missing-volume error detection in readListLine()
   changes; existing behavior for old p7zip is preserved

Log: fix missing-volume detection to support new 7-Zip 26.02 output

Influence:
1. Test opening a 7z split archive with a missing volume using new
   7-Zip 26.02 — should show "damaged" error directly
2. Test the same scenario with old p7zip 16.02 — behavior unchanged
3. Test opening a normal complete 7z archive — no regression

fix: 兼容新版7-Zip分卷缺失时的"Cannot"输出

1. 根因:readListLine() 硬编码旧版 p7zip 输出的 "Can not"(两个单词),
   新版 7-Zip 26.02 改为 "Cannot"(一个单词),匹配失败后走了 corrupt
   对话框路径而非直接报错
2. 方案:追加 "Cannot" 的 startsWith 匹配分支,保留原有 "Can not" 匹配,
   兼容旧版 p7zip 与新版 7-Zip
3. 影响:仅 readListLine() 中分卷缺失错误检测逻辑变化,旧版 p7zip 行为
   保持不变

Log: 修复分卷缺失检测以支持新版7-Zip 26.02输出

Influence:
1. 使用新版 7-Zip 26.02 打开分卷缺失的 7z 压缩包,验证直接提示"损坏"
2. 使用旧版 p7zip 16.02 打开分卷缺失的 7z 压缩包,验证行为不变
3. 正常打开完整的 7z 压缩包,验证无回归

PMS: BUG-376699
@sourcery-ai

sourcery-ai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates Cli7zPlugin::readListLine() to detect missing 7z volumes from both old p7zip and 7-Zip 26.02 output, preserving legacy behavior while preventing the newer message from falling through to the corrupt-archive dialog path.

Flow diagram for missing 7z volume error detection

flowchart TD
    A["readListLine(line)"] --> B{"line starts with old or new missing-volume message?"}
    B -->|"Can not"| C["Set m_eErrorType to ET_ArchiveDamaged"]
    B -->|"Cannot"| C
    C --> D["Set m_finishType to PFT_Error"]
    D --> E["Return false"]
    B -->|"No match"| F["Continue existing line processing"]
Loading

File-Level Changes

Change Details Files
Extend missing-volume error detection to recognize both legacy and current 7-Zip wording.
  • Add a parallel prefix match for Cannot while retaining the existing Can not match.
  • Route either recognized message through the existing damaged-archive error path.
3rdparty/cli7zplugin/cli7zplugin.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LiHua000, max-lvs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@LiHua000

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 960f07a into linuxdeepin:release/eagle Sep 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants