https://bugzilla.novell.com/show_bug.cgi?id=652818
https://bugzilla.novell.com/show_bug.cgi?id=652818#c2
--- Comment #2 from Pavol Rusnak 2010-11-11 16:51:23 CET ---
Using python-rpm parser might possible, but there are some limitations.
Consider the following snippet:
%pre
/sbin/ldconfig
%post
/sbin/ldconfig
# we might want to split devel files into separate package later
%files
%{_bindir}/foo
%{_include}/foo/
%{_libdir}/libfoo.*
The comment above %files section obviously belongs to %files section, but
parser sees it as a part of %post section - i.e. if I print this section it
will contain:
/sbin/ldconfig
--empty line--
# we might want to split devel files into separate package later
As we reorder sections in .spec file we would need to store also the original
order and somehow guess where the comment belongs and reappend it if needed.
You might want to check rpm bindings using this snippet:
import rpm
spkg = rpm.spec('foo.spec')
and then inspect spkg structure for various fields e.g. individual packages:
for p in spkg.packages:
print p.header['name']
I might do it as well, but I'm not sure if I find some time the following days.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.