Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Adapt to the new version of linglong #122

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

wangrong1069
Copy link

Adapt to the new version of linglong.

Log: Adapt to the new version of linglong.
Task: https://pms.uniontech.com/task-view-369975.html

Adapt to the new version of linglong.

Log: Adapt to the new version of linglong.
Task: https://pms.uniontech.com/task-view-369975.html
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 代码重复

    • arm64/linglong.yamllinglong.yamlloong64/linglong.yaml 三个文件中,修改服务的 Exec 行为的 sed 命令是相同的。建议将这些重复的代码提取到一个公共的函数或脚本中,以减少代码冗余。
  2. 硬编码路径

    • sed 命令中使用的路径(如 /usr/bin/deepin-draw${PREFIX}/share/dbus-1/services/com.deepin.Picker.service)是硬编码的。建议使用配置文件或环境变量来管理这些路径,以提高代码的可维护性和灵活性。
  3. 错误处理

    • sed 命令没有错误处理机制。如果 sed 命令执行失败,可能会导致构建过程失败。建议添加错误检查,并在失败时输出错误信息。
  4. 版本提取

    • 提取版本信息的命令 head -1 debian/changelog | awk -F'[()]' '{print $2}' 可能不适用于所有情况。如果 debian/changelog 文件格式发生变化,这个命令可能会失败。建议添加错误处理和格式验证。
  5. 代码注释

    • 注释应该简洁明了,但不应包含不必要的细节。例如,# 修改服务使用玲珑启动 这个注释可以更具体一些,比如 # 更新服务使用玲珑启动路径
  6. 文件权限

    • loong64/linglong.yaml 文件的权限被设置为 100755,这通常表示该文件是一个可执行文件。如果这个文件不应该被设置为可执行,建议将其权限设置为 100644

综上所述,建议对代码进行重构,提取重复的 sed 命令到一个公共函数中,使用配置文件或环境变量管理路径,添加错误处理机制,并确保版本提取命令的健壮性。同时,检查并修正文件权限,确保代码的可维护性和安全性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, wangrong1069

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

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

@wangrong1069
Copy link
Author

/merge

@deepin-bot deepin-bot bot merged commit 99bf06e into linuxdeepin:develop/snipe Dec 13, 2024
14 checks passed
@wangrong1069 wangrong1069 deleted the bug-1213 branch December 13, 2024 08:55
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