Skip to content

Conversation

@deepin-mozart
Copy link
Contributor

@deepin-mozart deepin-mozart commented Nov 6, 2025

…different versions

Log:
Change-Id: I2d259541537474af7e422f610943ac6efdb4a1d6

Summary by Sourcery

Adapt CMake configuration to detect and use either the new lxqt2-build-tools package or the traditional lxqt-build-tools package to maintain compatibility across LXQt versions

Bug Fixes:

  • Support both lxqt2-build-tools and lxqt-build-tools package names for compatibility with different LXQt versions

Enhancements:

  • Add conditional logic in CMakeLists to try lxqt2-build-tools first and fall back to lxqt-build-tools
  • Display status messages indicating which lxqt-build-tools package was found

…different versions

Log:
Change-Id: I2d259541537474af7e422f610943ac6efdb4a1d6
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepin-mozart

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

The pull request process is described 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 Nov 6, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Update the CMake dependency resolution to first attempt locating the newer lxqt2-build-tools package before falling back to the legacy lxqt-build-tools, ensuring compatibility across LXQt versions.

Flow diagram for updated lxqt-build-tools package resolution logic

flowchart TD
    A["Start CMake configuration"] --> B["Attempt to find lxqt2-build-tools"]
    B -->|Found| C["Use lxqt2-build-tools"]
    B -->|Not Found| D["Attempt to find lxqt-build-tools"]
    D -->|Found| E["Use lxqt-build-tools"]
    D -->|Not Found| F["CMake error: Required package not found"]
Loading

File-Level Changes

Change Details Files
Introduce dual-package search logic for lxqt-build-tools
  • Replace direct find_package(lxqt-build-tools) with a quiet search for lxqt2-build-tools
  • Add conditional branch: if lxqt2-build-tools is found, emit a status message
  • Fallback to required find_package(lxqt-build-tools) when lxqt2-build-tools is not found
  • Insert status messages for both package findings
3rdparty/unioncode-qtermwidget-0.14.1/CMakeLists.txt

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

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.

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个 CMakeLists.txt 的修改进行审查:

  1. 语法逻辑:
  • 修改的语法是正确的,使用了 CMake 的 find_package 命令和条件判断
  • 逻辑流程合理:先尝试查找新版本包,如果找不到再查找旧版本包
  • 使用了 QUIET 参数来避免第一次查找失败时的警告信息,这是很好的做法
  1. 代码质量:
  • 代码结构清晰,注释充分,便于理解修改的目的
  • 使用了 message(STATUS) 来输出找到的包名,有助于调试和确认
  • 变量命名符合 CMake 规范
  1. 代码性能:
  • 这种修改不会对构建性能产生显著影响
  • find_package 操作的执行时间很短,而且最多只会执行两次
  1. 代码安全:
  • 修改是安全的,不会引入安全风险
  • 保持了原有的 REQUIRED 属性,确保至少找到一个必需的包

改进建议:

  1. 可以考虑在 else 分支中也添加一个警告信息,提示使用的是旧版本包:
else()
    find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
    message(STATUS "Found lxqt-build-tools package (legacy version)")
endif()
  1. 可以考虑添加一个变量来记录找到的包名,方便后续使用:
if(lxqt2-build-tools_FOUND)
    set(LXQT_BUILD_TOOLS_PACKAGE "lxqt2-build-tools")
    message(STATUS "Found lxqt2-build-tools package")
else()
    set(LXQT_BUILD_TOOLS_PACKAGE "lxqt-build-tools")
    find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
    message(STATUS "Found lxqt-build-tools package")
endif()
  1. 如果这个检查逻辑可能被多处使用,建议将其封装成一个函数:
function(find_lxqt_build_tools)
    find_package(lxqt2-build-tools ${LXQTBT_MINIMUM_VERSION} QUIET)
    if(lxqt2-build-tools_FOUND)
        message(STATUS "Found lxqt2-build-tools package")
    else()
        find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
        message(STATUS "Found lxqt-build-tools package")
    endif()
endfunction()

总的来说,这是一个很好的修改,解决了不同版本 lxqt-build-tools 包名兼容性的问题,代码质量较高,只需要一些小的改进来提升可维护性和用户体验。

@deepin-mozart
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Nov 6, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 97d0025 into linuxdeepin:master Nov 6, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants