On Fri, Jun 20, 2014 at 8:00 PM, Jeff Peeler jpeeler@redhat.com wrote:
It would be great if there were a solution available in python, but I've not found anything in the TransactionSet API of value. Surely this must be possible as "fedpkg mockbuild" works as expected.
This looks wrong but actually works just fine:
In [1]: import rpm
In [2]: rpm.spec('js-jquery.spec') Out[2]: <rpm.spec at 0x7f223f00bb70>
In [3]: rpm.expandMacro('%{shortcommit}') Out[3]: '4dec426'
(%{shortcommit} in this spec is used as explained in [1].)
There ought to be a more OO-way but I couldn't find it poking around when I needed this awhile ago.
-T.C.
[1] http://fedoraproject.org/wiki/Packaging:SourceURL#Github