简体   繁体   English

Java apis用于查询文件的RPM包信息

[英]Java apis to query RPM package information for file

In Linux, RPM package information for a file can be determined using the 'rpm -qf' option. 在Linux中,可以使用'rpm -qf'选项确定文件的RPM包信息。 Is anyone aware of a JAVA library which supports these kind of operations? 是否有人知道JAVA库支持这些操作?

Eg: 例如:

/bin # rpm -qf grep
grep-2.7-5.7.1

I am unaware of any library that provides an easy API to check RPM package info. 我不知道任何库提供了一个简单的API来检查RPM包信息。 You can, however, use Java to execute shell commands and interpret their results. 但是,您可以使用Java来执行shell命令并解释其结果。

Some more info: 更多信息:

There is Redline RPM , which has a Scanner that might do what you want. Redline RPM ,它有一个可能做你想要的扫描仪 I've used it to package RPMs via Ant/Maven, but never to read them. 我用它来通过Ant / Maven打包RPM,但从来没有读过它们。

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

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