#24 Move operations on RPM SPEC file into a separate class or module
Opened by cqi. Modified

rpkg gets RPM package metadata from SPEC file via both rpm python binding and rpm command. There are duplicate code handling successful rpm command execution or the potential failure. All the code to get RPM package metadata are mixed in individual methods. It must be nice to move them into a separate dedicated place with exposing easy-to-call APIs.

Usage:

  • get arches from main package and each subpackages in Commands._get_build_arches_from_spec.
  • get change logs in Commands.clog.
  • get name, version, release and epoch in Commands.load_nameverrel.

The final solution should be easy to use and easy to get package metadata, like:

spec = RPMSpec('/path/to/spec')
print(spec.name)
print(spec.version)
print(spec.release)
print(spec.epoch)
print(spec.arches)
print(spec.changelogs)

In addition, another big benefit is not to depend on rpm-py-installer any more and hack requires in the egginfo.


Metadata Update from @cqi:
- Issue tagged with: refactor

Metadata Update from @cqi:
- Issue assigned to cqi

Metadata