Revert "deps: migrate from p7zip-full to 7zip package"#391
Revert "deps: migrate from p7zip-full to 7zip package"#391lzwind merged 1 commit intolinuxdeepin:masterfrom
Conversation
由于系统依赖还没有完善,归档管理器的这笔提交先回滚。后续系统依赖处理了再添加进去。 This reverts commit 1d92532.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReverts a previous migration from p7zip-full to 7zip by restoring p7zip as the runtime dependency, narrowing CLI plugin version parsing back to p7zip-only, and adjusting tests and comments to match the reverted behavior. Class diagram for reverted Cli7zPlugin version parsing behaviorclassDiagram
class Cli7zPlugin {
+bool readListLine(line: QString)
-int m_parseState
-QRegularExpression rxVersionLine
-QRegularExpressionMatch matchVersion
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Even though the dependency is reverted to p7zip-full, consider keeping the more general version-line regex that accepts both
p7zipand7-Zipformats to avoid unnecessarily dropping compatibility if7zis present on some systems. - In
UiTools::createInterface, the comments refer to removing the “P7zip” plugin while the runtime filter checksplugin->metaData().name().contains("7zip"); ensure the terminology matches the actual plugin metadata to avoid confusion when reading or debugging this logic.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Even though the dependency is reverted to p7zip-full, consider keeping the more general version-line regex that accepts both `p7zip` and `7-Zip` formats to avoid unnecessarily dropping compatibility if `7z` is present on some systems.
- In `UiTools::createInterface`, the comments refer to removing the “P7zip” plugin while the runtime filter checks `plugin->metaData().name().contains("7zip")`; ensure the terminology matches the actual plugin metadata to avoid confusion when reading or debugging this logic.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review代码审查报告总体概述这次代码变更主要是将项目从依赖 详细审查意见1. cli7zplugin.cpp 中的正则表达式修改问题: - const QRegularExpression rxVersionLine(QStringLiteral("^(?:p7zip Version|7-Zip) ([\\d\\.]+) .*$"));
+ const QRegularExpression rxVersionLine(QStringLiteral("^p7zip Version ([\\d\\.]+) .*$"));分析:
建议:
改进代码示例: const QRegularExpression rxVersionLine(QStringLiteral("^p7zip Version ([\\d\\.]+) .*$"));
QRegularExpressionMatch matchVersion = rxVersionLine.match(line);
if (!matchVersion.hasMatch()) {
qWarning() << "Failed to parse p7zip version from line:" << line;
return false;
}
QString version = matchVersion.captured(1);
qDebug() << "Detected p7zip version:" << version;
// 可选:添加版本检查
if (version < "16.00") {
qWarning() << "p7zip version" << version << "is too old, minimum required is 16.00";
return false;
}2. 依赖项变更变更: -Depends: ${shlibs:Depends}, ${misc:Depends}, 7zip, deepin-shortcut-viewer, ...
+Depends: ${shlibs:Depends}, ${misc:Depends}, p7zip-full, deepin-shortcut-viewer, ...分析:
建议:
3. 插件名称变更变更: -"Name": "7-Zip plugin",
+"Name": "P7zip plugin",分析:
建议:
4. 测试代码变更变更: -TEST_F(UT_Cli7zPlugin, test_readListLine_002)
-{
- m_tester->m_parseState = ParseStateTitle;
- // 兼容p7zip和7z版本格式 - 测试7z版本
- EXPECT_EQ(m_tester->readListLine("7-Zip 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20"), true);
- EXPECT_EQ(m_tester->m_parseState, ParseStateHeader);
-}
-
-TEST_F(UT_Cli7zPlugin, test_readListLine_002_p7zip)
-{
- m_tester->m_parseState = ParseStateTitle;
- // 兼容p7zip和7z版本格式 - 测试p7zip版本(向后兼容)
+TEST_F(UT_Cli7zPlugin, test_readListLine_002)
+{
+ m_tester->m_parseState = ParseStateTitle;
EXPECT_EQ(m_tester->readListLine("p7zip Version 16.02 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,16 CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (A0655),ASM,AES-NI)"), true);
EXPECT_EQ(m_tester->m_parseState, ParseStateHeader);
}分析:
建议:
改进测试示例: TEST_F(UT_Cli7zPlugin, test_readListLine_002_valid_p7zip)
{
m_tester->m_parseState = ParseStateTitle;
EXPECT_EQ(m_tester->readListLine("p7zip Version 16.02 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,64 bits,16 CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (A0655),ASM,AES-NI)"), true);
EXPECT_EQ(m_tester->m_parseState, ParseStateHeader);
}
TEST_F(UT_Cli7zPlugin, test_readListLine_002_invalid_version)
{
m_tester->m_parseState = ParseStateTitle;
// 测试无效版本格式
EXPECT_EQ(m_tester->readListLine("Invalid version string"), false);
EXPECT_EQ(m_tester->m_parseState, ParseStateTitle); // 状态不应改变
}
TEST_F(UT_Cli7zPlugin, test_readListLine_002_old_version)
{
m_tester->m_parseState = ParseStateTitle;
// 测试非常旧的版本
EXPECT_EQ(m_tester->readListLine("p7zip Version 9.20 (locale=zh_CN.UTF-8)"), false); // 假设拒绝旧版本
EXPECT_EQ(m_tester->m_parseState, ParseStateTitle); // 状态不应改变
}5. .gitignore 变更变更: -.npm-cache/
\ No newline at end of file分析:
建议:
安全性考虑
性能考虑
总结这次变更主要是将项目从 7zip 切换到 p7zip-full,整体方向合理,但需要关注以下几点:
建议在合并前进行全面的测试,确保所有功能在 p7zip-full 下都能正常工作。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
由于系统依赖还没有完善,归档管理器的这笔提交先回滚。后续系统依赖处理了再添加进去。
This reverts commit 1d92532.
Summary by Sourcery
Revert the previous migration from the 7zip package back to the legacy p7zip-full tooling and expectations across code, tests, and packaging metadata.
Bug Fixes:
Build:
Documentation: