Better way to this ?? Query database to xml

Michael A. Peters mpeters at
Sun Apr 5 10:40:22 UTC 2009

The ugly string

rpm -qa --qf '<package name="%{name}">\n  \
<epoch>%{epoch}</epoch>\n  \
<version>%{version}</version>\n  \
<release>%{release}</release>\n  \
<arch>%{arch}</arch>  \
<summary>%{summary}</summary>\n  <vendor>%{vendor}</vendor>\n</package>\n'

The issue - it can produce malformed xml because vendor string can and 
does sometimes contain < and >

I'm thinking there probably is a better to do it with python straight 
from the database? Maybe even something already exists for this?

More information about the Rpm-list mailing list