简体   繁体   English

文件在rpm spec文件中列出两次

[英]File listed twice in rpm spec file

The files section of my spec-file looks like this: 我的spec文件的files部分如下所示:

%files
%{prefix}/htdocs/
%config %{prefix}/htdocs/share/settings/config.inc.php

Now, since the config file is already included in the %{prefix}/htdocs/ line I get the warning 'File listed twice'. 现在,由于配置文件已包含在%{prefix}/htdocs/行中,因此我收到警告“文件列出两次”。

One way around would be, to list every single file within %{prefix}/htdocs/ , except the config file. 一种方法是列出%{prefix}/htdocs/中的每个文件,但配置文件除外。

But my question is: Is there a better way around this issue, than listing all files? 但我的问题是:除了列出所有文件之外,还有更好的解决方法吗?

Unfortunately not. 不幸的是。 RPM is quite oldschool software, but works fine :-) RPM是相当oldschool的软件,但工作正常:-)

But you can use globs too: 但你也可以使用globs:

%files
%{prefix}/htdocs/*.png
%{prefix}/htdocs/*.html

etc. 等等

This will enable you to include all the rest without some other files you do not want there. 这将使您能够包含所有其余的,而不需要其他您不想要的文件。 That's the way how RPM packagers do it usually. 这就是RPM包装商通常采用的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM