我已经使用Debhelper打包了Debian应用程序。应用程序的配置文件位于/opt/{package}/releases/default/下,而不是/etc/{package}/下,不能很容易地移动。直到最近,标记此配置文件为conffile所需的所有内容都是将其包含在打包文件debian/{package}.conffiles中。这产生了预期的效果,apt/dpkg将在升级时检测到配置文件的本地更改,并以智能的方式处理它,而不是用打包的版本破坏本地更改。
在将包工具升级到较新的版本之后,我不再享受这一好处。手册页dh_installdeb(1)内容如下:
{package}.conffiles:
Historically, this file was needed to manually mark files files as
conffiles. However, it has become de facto obsolete since debhelper
automatically computed which files should be marked as conffiles.此外,请参阅Debian新维护人员指南:
5.3. conffiles
dh_installdeb(1) automatically flags any files under the /etc directory
as conffiles, so if your program only has conffiles there you do not
need to specify them in this file. For most package types, the only place
conffiles should ever be is under /etc, and so this file doesn't need to exist.我的问题是如何通过将配置文件保存在/opt/下来实现旧的行为?
发布于 2022-11-24 07:27:20
Debian政策说,配置文件必须在/etc中,如果修改包直接从/etc读取是不可行的,则使用符号链接:
10.7.2.您的包创建或使用的任何配置文件必须驻留在
/etc中。...如果您的包在/etc之外创建或使用配置文件,并且不可能修改包直接使用/etc,将文件放在/etc中并从包所需的位置创建指向这些文件的符号链接。
https://serverfault.com/questions/1091101
复制相似问题