RPM Format

RPM Format

Support for the RPM archive format.

The RPM Format package is 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)