RPM Format Package
2023-11-27 18:23:47 Author: blog.cerbero.io(查看原文) 阅读量:12 收藏

Skip to content

We have released the RPM Format package for all licenses of Cerbero Suite.

The RPM Package Manager (RPM) format is a package management system used primarily in Red Hat-based Linux distributions, including Fedora and CentOS. It is utilized for managing the installation, update, and removal of software on Linux systems. An RPM file contains the software itself, along with metadata about the software such as its version, dependencies, and instructions for installation. This format streamlines the process of software management, providing a standardized approach to handling packages on Linux platforms.

The package is also exposed to the SDK:

from Pro.Core import *
from Pkg.RPM import *

def parseRPMArchive(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = RPMObject()
    if not obj.Load(c) or not obj.ParseArchive():
        return
    n = obj.GetEntryCount()
    for i in range(n):
        entry = obj.GetEntry(i)
        if entry == None:
            break
        # skip directories
        if not obj.IsFile(entry):
            continue
        print("file name:", entry.name)
        # retrieves the file data as NTContainer
        fc = obj.GetEntryData(entry)

文章来源: https://blog.cerbero.io/?p=2877
如有侵权请联系:admin#unsafe.sh