在我的 rpm 中,我有一个完整的目录,我想用 %config(noreplace) 标记它。该目录中有一个文件,我想在每次安装时使用 %config 中的语义将其替换为最新的 rpm。
使用此处的指南:http://www-uxsup.csx.cam.ac.uk/~jw35/docs/rpm_config.html http://www-uxsup.csx.cam.ac.uk/~jw35/docs/rpm_config.html,我尝试了以下方法:
%files
%config(noreplace) /my/saved/dir/*
%config /my/saved/dir/file1
and
%files
%config /my/saved/dir/file1
%config(noreplace) /my/saved/dir/*
希望特定命令能够覆盖 glob,但它不起作用。是否有任何类似 RPM 的命令可以用来强制对嵌套在 %config(noreplace) 目录下的文件执行 %config 行为?
From:
http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
%config 指令有一个限制,并且该限制
%config 后面不能有多个文件名。这意味着
以下示例是指定配置的唯一允许的方式
文件:
%config /etc/foonly
请注意,该文件的完整路径是必需的,因为它是在构建时安装的。
但是,您可以在 %install 部分动态制作该列表:
%install
echo '%dir /etc' >> list.txt
echo '%config(noreplace) /etc/foo' >> list.txt
# use for-loop or any other shell scripting technique
%files -f list.txt
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)