我正在寻找一个解决方案来查询一个RPM规范文件,以获得它安装的文件列表,最好不用构建包。我尝试过rpmspec --queryformat '%{filenames}',但它只会导致(none)
示例test.spec:
Name: test
Version: 1
Release: 1%{?dist}
Summary: test
License: bsd
URL: http://localhost
Source0: test.tgz
%description
%install
%files
/usr/foo.txt测试运行:
$ rpmspec --builtrpms -q --qf 'name: %{name}\nfiles: %{filenames}\n\n' test.spec
name: test
files: (none)预期结果:
name: test
files: /usr/foo.txt发布于 2021-09-22 23:17:38
规范文件不知道安装了多少个文件。
如果它有这样的东西:
%files
/path/to/a/ton/of/files/在构建软件之后,它不可能知道目录中有多少文件。
如果您已经构建了RPM,您可以使用rpm -qlp <rpmfile>查看它将安装的文件,而无需执行实际安装。但同样,你需要一个内置的RPM。
https://stackoverflow.com/questions/69283310
复制相似问题