dpkg力在preint之后停止

发布于 2025-02-09 12:53:34 字数 641 浏览 2 评论 0 原文

我构建自己的软件包,需要在安装过程之前检查系统上的某些内容。

因此,在我的DPKG中,我添加了一个前脚本,如下所示。作为一个例子,我想检查是否可用arduino-cli命令:

echo 'Check arduino cli install ...'
if ! command -v arduino-cli &> /dev/null
then
   exit 0
fi

indst脚本似乎已执行。这是DPKG执行的结果:

....
dpkg: error processing archive myserver-server_0_amd64.deb (--install):
...

如何停止其他脚本?我认为退出命令应该起作用。 https://www.debian.orgian.orgian.orgian.org/debian.org/doc/debian-debian-policy/ ch-Maintainerscripts.html

I build my own package and I need to check something on the system before the install process.

So in my dpkg I add a preinst script which is written as follow. As an example I want to check if the arduino-cli command is available:

echo 'Check arduino cli install ...'
if ! command -v arduino-cli &> /dev/null
then
   exit 0
fi

The postinst script seems to be execute. Here is the result of the dpkg execution:

....
dpkg: error processing archive myserver-server_0_amd64.deb (--install):
...

How can I stop the other script ? I thought the exit command should work.
https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑白记忆 2025-02-16 12:53:34

同意评论中所说的话。

停止安装不是要走的路,而是最大程度地协助用户以正确安装软件包。

为什么要让人们在自动化时手动安装内容?

因此:

  • 将依赖关系添加到 debian/Control 文件

  • 添加 curl 依赖项到 debian/control 文件
  • 修改您的现有代码以安装通过使用Arduino-Cli
    if ! command -v arduino-cli &> /dev/null
    then
       curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
    fi

Agreed with what was said in comments.

Stopping an installation is not the way to go, instead assist the user at the maximum in order to install your package correctly.

Why asking people to install things manually while you can automate it?

Thus:

  • Add the dependency to the debian/control file

OR

  • Add curl dependency to the debian/control file
  • Modify your existing code to install arduino-cli by using
    if ! command -v arduino-cli &> /dev/null
    then
       curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
    fi
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文