为什么在Yocto中尝试安装之间出现/ etc / cups冲突?

egf*_*nor 4 linux cups yocto

我有一个编译打印机驱动程序的方法,并且在do_install中有几行简单的代码可以运行。

do_install() {
  install -d ${D}${libdir}/cups/filter
  install -m 755 ${B}/src/rastertoprinter ${D}${libdir}/cups/filter/
  install -d ${D}${sysconfdir}/cups/ppd
  install -m 755 ${B}/../rastertoprinter/printer_name.ppd ${D}${sysconfdir}/cups/ppd/
}
Run Code Online (Sandbox Code Playgroud)

为了编译源代码,我在杯子上有一个DEPENDS,在杯子上也有一个RDEPENDS,因为OS当然需要安装杯子才能打印。

打印机驱动程序不是公开可用的,因此我已将其重命名为rastertoprinter并更改了路径名。

本质上,我只需要简单地创建或确保目录/ usr / lib / cups / filter存在,然后在其中复制rastertoprinter程序。我还需要创建或确保目录/ etc / cups / ppd存在并将.ppd文件复制到该目录中。

前两行运行正常,但第三行抛出以下错误:

file /etc/cups conflicts between attempted installs of printername-r0.corei7_64 and cups-2.2.2-r0.corei7_64
file /etc/cups/ppd conflicts between attempted installs of printername-r0.corei7_64 and cups-2.2.2-r0.corei7_64
Run Code Online (Sandbox Code Playgroud)

我不明白为什么两个食谱都无法创建此目录并在其中添加内容?奇怪的是,我可以做第一个/ usr / lib / cups / filter目录,尽管很好。

Pau*_*opf 6

事实证明,要打包在Yocto中的每个文件也会%dir为每个文件的每个父文件生成一个。我们不想拥有另一个软件包所拥有的目录,因此如果将其添加到配方中:

DIRFILES = "1"
Run Code Online (Sandbox Code Playgroud)

这将导致您的程序包不拥有您程序包文件的父目录。

这将生成一个没有%dir条目的rpm规范文件。