【问题标题】:debian lintian warns about non existing conffiledebian lintian 警告不存在的 conffile
【发布时间】:2015-09-22 08:59:38
【问题描述】:

我收到来自 lintian 的警告和一个错误:

W: openrobertalab: init.d-script-not-marked-as-conffile etc/init.d/openrobertalab
E: openrobertalab: init.d-script-not-included-in-package etc/init.d/openrobertalab

我不明白的是我的包中没有etc/init.d/openrobertalab这样的文件:

dpkg --contents openrobertalab_1.3.0-1_amd64.deb | grep etc
drwxr-xr-x root/root         0 2015-09-22 10:53 ./etc/
drwxr-xr-x root/root         0 2015-09-22 10:53 ./etc/dbus-1/
drwxr-xr-x root/root         0 2015-09-22 10:53 ./etc/dbus-1/system.d/
-rw-r--r-- root/root       489 2015-09-22 10:53 ./etc/dbus-1/system.d/openrobertalab.conf

如果我遵循 lintiants 的建议并创建一个 debian/openrobertalab.conffiles 列出此不存在的文件,则包构建失败:

dpkg-deb: error: conffile `etc/init.d/openrobertalab' does not appear in package
dh_builddeb: dpkg-deb --build debian/openrobertalab .. returned exit code 2
make: *** [binary] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

有什么想法吗?

【问题讨论】:

  • 我猜它存在于构建的etc 目录中,但不确定哪个精确路径以及构建过程的哪个阶段。我猜你需要增加 debian/rules 才能将它实际包含在包中。
  • 我搜索了包的临时目录,根本没有etc/init.d:/
  • 为了对问题进行适当的分析,我们需要查看更多代码;例如debian/ 的内容(或打包仓库的链接)

标签: debian lintian


【解决方案1】:

我设法通过将以下几行添加到我的规则文件中来“修复”这个问题:

override_dh_installinit:
# don't do anything, silences lintian warnings

【讨论】:

  • 相反,您可能想知道为什么 dh_installinit 首先要安装脚本。
【解决方案2】:

首先,联系文档,实际的 lintian 错误是什么意思:

 lintian-info --tags \
       init.d-script-not-included-in-package \
       init.d-script-not-marked-as-conffile

第一个警告的解释表明,您的包的 postinst 脚本安装了一个 init 脚本,但它不是包的一部分。

因此,正确的解决方案是修复包的维护者脚本。

【讨论】:

  • 当然,当我搜索错误时,我会看到这样的页面:lintian.debian.org/tags/…,这些都非常无用。我也没有发现对 lintian 文档 (lintian.debian.org/manual/index.html) 中的检查有任何帮助。感谢您指出“lintian-info --tags”,我无法理解为什么该工具未将其包含在输出中:/
  • 但是要评论你的结论,我的 postinst 脚本没有安装任何东西 (gist.github.com/ensonic/14f5f3d2bceb90de5e07)
  • 假设这是手动维护的 debian/postinst 脚本,实际的 postinst 脚本是什么样子的(在 dh 添加内容之后)?
  • 我在哪里可以找到那个?
  • 在生成的 .deb 文件中:例如ar xvf yourpackage.deb && tar xvf control.tar.gz && cat postinst
猜你喜欢
  • 2020-09-26
  • 1970-01-01
  • 1970-01-01
  • 2013-01-20
  • 2017-12-08
  • 2014-05-07
  • 2011-12-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多