读取RPM存档文件
rpmfile的Python项目详细描述
rpm文件
用于检查python中的rpm文件的工具。此模块是根据 tarfile模块。
示例
importrpmfilewithrpmfile.open('file.rpm')asrpm:# Inspect the RPM headersprint(rpm.headers.keys())print(rpm.headers.get('arch','noarch'))# Extract a fileobject from the archivefd=rpm.extractfile('./usr/bin/script')print(fd.read())formemberinrpm.getmembers():print(member)
课程
- rpmfile.rpmfile:rpmfile对象提供了到RPM存档的接口
- rpmfile.rpminfo:rpminfo对象表示rpmfile中的一个成员。