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

Why do I get /etc/cups conflicts between attempted installs in 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/
}

为了编译源代码,我有一个 DEPENDS on cups 和一个 RDEPENDS on cups,因为 OS 当然需要安装 cups 才能打印。

打印机驱动程序不是公开可用的,因此我已将其重命名为 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

我不明白为什么这两个食谱都不能创建这个目录并在里面放东西?奇怪的是我能够做第一个 /usr/lib/cups/filter 目录虽然很好。

原来的问题是,要在 Yocto 中打包的每个文件也会为每个文件的每个父文件生成一个 %dir。我们不想拥有一个属于另一个包的目录,所以如果你把这个添加到你的食谱中:

DIRFILES = "1"

这会导致您的包不拥有您打包的文件的父目录。

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