Skip to content

Pr1030#182

Merged
lzwind merged 2 commits intolinuxdeepin:masterfrom
wangrong1069:pr1030
Oct 30, 2025
Merged

Pr1030#182
lzwind merged 2 commits intolinuxdeepin:masterfrom
wangrong1069:pr1030

Conversation

@wangrong1069
Copy link
Contributor

@wangrong1069 wangrong1069 commented Oct 30, 2025

Summary by Sourcery

Enhancements:

  • Enable exFAT creation support unconditionally when mkfs.exfat is present by removing the version check

"mkfs.exfat -V" returns 1 in exfatprogs and 0 in the exfat-utils
package. To ensure compatibility with both packages, we only check if
"mkfs.exfat" exists.

Log: Adapt to exfatprogs
Bug: https://pms.uniontech.com/bug-view-338971.html
As title.

Log: Update version to 6.0.21
@github-actions
Copy link

TAG Bot

TAG: 6.0.21
EXISTED: no
DISTRIBUTION: unstable

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wangrong1069

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

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 30, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR streamlines ExFat filesystem support by removing unnecessary version checks and debug logs in the create path, and updates the Debian changelog for the new release.

Class diagram for updated ExFat filesystem support

classDiagram
class ExFat {
  +getFilesystemSupport() FS
}
class FS {
  create
  EXTERNAL
}
class Utils {
  +findProgramInPath(program: QString): QString
  +executCmd(cmd: QString, output: QString, error: QString): int
}
ExFat --> FS
ExFat --> Utils

%% The getFilesystemSupport method in ExFat now sets fs.create to FS::EXTERNAL if mkfs.exfat is found, without version check.
Loading

File-Level Changes

Change Details Files
Simplify ExFat create support detection logic
  • Remove mkfs.exfat version check and conditional
  • Always enable create support when mkfs.exfat is present
  • Eliminate redundant debug log statements
service/diskoperation/filesystems/exfat.cpp
Update Debian changelog
  • Bump and revise changelog entry for this update
debian/changelog

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

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这段代码变更进行审查:

  1. 代码逻辑改进:
  • 移除了对 mkfs.exfat 版本的检查逻辑,简化了代码流程
  • 当找到 mkfs.exfat 程序时直接启用创建支持
  1. 代码质量分析:
    优点:
  • 代码更加简洁,移除了不必要的版本检查
  • 减少了执行外部命令的次数,提高了代码执行效率
  • 日志输出更清晰,去掉了冗余的版本检查相关日志

潜在问题:

  • 移除版本检查可能会导致在某些不兼容的旧版本 mkfs.exfat 上出现问题
  • 没有对 mkfs.exfat 的实际可用性进行验证
  1. 安全性考虑:
  • 移除了版本检查可能会引入兼容性风险
  • 建议至少保留最低版本检查,确保使用的 mkfs.exfat 版本满足基本功能要求
  1. 性能影响:
  • 正面影响:减少了外部命令执行次数,提高了性能
  • 负面影响:如果遇到不兼容版本,可能导致运行时错误

改进建议:

  1. 建议保留基本的版本检查,至少确保 mkfs.exfat 版本满足最低要求
  2. 可以添加一个简单的功能测试,比如执行 mkfs.exfat --help 来验证程序是否可用
  3. 考虑添加版本号常量定义,方便维护最低版本要求
  4. 建议在日志中记录 mkfs.exfat 的版本信息,便于问题追踪

示例改进代码:

const QString MIN_EXFAT_VERSION = "1.3.0"; // 定义最低版本要求

if (!Utils::findProgramInPath("mkfs.exfat").isEmpty()) {
    if (Utils::executCmd("mkfs.exfat -V", output, error) == 0) {
        QString version = extractVersion(output); // 提取版本号的辅助函数
        if (compareVersion(version, MIN_EXFAT_VERSION) >= 0) {
            qDebug() << "mkfs.exfat found, version" << version << "enabling create support";
            fs.create = FS::EXTERNAL;
        } else {
            qDebug() << "mkfs.exfat version" << version << "is too old, minimum required:" << MIN_EXFAT_VERSION;
        }
    }
}

这样的改进既保证了代码的简洁性,又确保了版本兼容性,同时提供了更好的错误处理和日志记录。

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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