Skip to content

fix: 修复更新时postinst脚本错误#54

Merged
Zeno-sole merged 1 commit into
linuxdeepin:masterfrom
Zeno-sole:zeno/fix-deb
Nov 25, 2024
Merged

fix: 修复更新时postinst脚本错误#54
Zeno-sole merged 1 commit into
linuxdeepin:masterfrom
Zeno-sole:zeno/fix-deb

Conversation

@Zeno-sole

Copy link
Copy Markdown
Contributor

update postinst

Log:

@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 2024.11.25
EXISTED: no
DISTRIBUTION: unstable

@Zeno-sole

Copy link
Copy Markdown
Contributor Author

/integrate

@github-actions

Copy link
Copy Markdown

AutoIntegrationPr Bot
auto integrate with pr url: deepin-community/Repository-Integration#2266
PrNumber: 2266
PrBranch: auto-integration-12001817215

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

  1. 代码重复

    • x86_64loongarch64riscv64aarch64架构的代码块中,firefox.desktop的链接创建逻辑是相同的。可以考虑将这部分代码提取到一个函数中,以减少代码重复。
  2. 错误处理

    • 在链接创建过程中使用了|| true来忽略错误。虽然这可以避免脚本因错误而终止,但更好的做法是使用set -e来确保脚本在遇到错误时立即退出,或者使用trap来处理错误。
  3. 代码格式

    • 代码缩进不一致,特别是在if语句内部。建议统一缩进风格,以提高代码的可读性。
  4. 变量命名

    • 变量ARCH的命名不够直观,建议使用更具描述性的变量名,如architecture
  5. 注释

    • 缺少对代码功能的注释,特别是对于复杂的逻辑和条件判断,添加注释有助于其他开发者理解代码意图。
  6. 路径硬编码

    • 路径/var/lib/linglong/entries/share/applications/org.deepin.browser.desktop/usr/share/applications/firefox.desktop是硬编码的。建议使用配置文件或环境变量来管理这些路径,以便于维护和修改。
  7. 逻辑错误

    • x86_64架构的代码块中,检查文件是否存在后直接创建链接,但没有检查目标链接是否已经存在。如果目标链接已经存在,可能会导致重复链接的问题。

综合以上意见,建议对代码进行重构,以提高代码的可读性、可维护性和健壮性。

@Zeno-sole

Copy link
Copy Markdown
Contributor Author

/integrate

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hudeng-go, Zeno-sole

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

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.

3 participants