我有许多我想获取的常用函数,因此可以在 debian 维护者脚本(preinst/postinst/prerm/postrm)中使用,称之为 common.sh。
如果我将“common.sh”添加到 DEBIAN 目录,dpkg 会抱怨:
dpkg-deb: warning: conffile '' is not a plain file
dpkg-deb: warning: ignoring 1 warning about the control file(s)
但是,包可以正确构建。
当我安装时,很难找到我的 common.sh 所在的正确目录。在 preinst 它似乎在寻找/var/lib/dpkg/tmp.ci
,而在 postinst 它似乎在寻找/var/lib/dpkg/info
。
我可以将 common.sh 粘贴在 tmp 目录中并稍后将其删除,但我觉得安装到操作系统的文件应该保留它们,直到 dpkg 可以删除它们。
无论如何,我想知道真正的“debian”方式是什么?