softwarefactory-project / rdopkg

power to the packagers
Apache License 2.0
28 stars 21 forks source link

specfile: expose spec parser/editor using CLI #104

Open yac opened 7 years ago

yac commented 7 years ago

utils.specfile.Spec parser is pretty useful with increasingly more unit tests supporting its fragile regexp core. I'd like to expose the useful functions using new CLI actions:

rdopkg spec-get-tag Version
rdopkg spec-set-tag Release "0.1%{?milestone}%{?dist}"

rdopkg spec-get-macro milestone
rdopkg spec-set-macro milestone .0rc2
rdopkg spec-eval '%{?secretmacro}'

rdopkg spec-get-magic-comment patches_base
rdopkg spec-set-magic-comment patches_ignore DROP-IN-RPM

while also supplying these basic spec operations with unit tests AND allowing better debugging.

What's not to like?

yac commented 7 years ago

Preferably, I'd left out the spec- prefix since rdopkg is implicitly about .spec manipulation... so

rdopkg get-tag
rdopkg get-macro
...

What do you think?

yac commented 5 years ago

This is best done just after #172 .