Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to wrap RPM output in XML?

Status
Not open for further replies.

goBoating

Programmer
Feb 8, 2000
1,606
0
0
US
man rpm says that I can use the --queryformat with the :xml arg to wrap the output of rpm in XML. I cannot find an example of the syntax.

Getting formats is pretty straight forward:
Code:
>rpm -qa -qf "%{NAME}\n"

But, how do I use the 'qf' functionality to tell it to wrap the output in XML, as it says it can?

Thanks

'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Code:
$ rpm  -qa --queryformat "%{NAME:xml}\n"
        <string>tzdata</string>
        <string>xkeyboard-config</string>
        <string>gnome-backgrounds</string>
        <string>glib2</string>
        <string>libusb</string>
        <string>libpng</string>
        ...

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Yep. That's it. Thanks a ton.

I also found that you can wrap the full output of rpm like:

Code:
$ rpm -q -xml httpd




'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top