Re: rpm processing using rpm.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 23 Mar 2004, root wrote:

> Hello Friends,
>  I am in immediate need of some help and suggestions. I want to read all
> the rpms currently installed in my system and then process the
> information. I adopted some weired method to do this but its slow. 
> 
> #Generate the rpm list and store in the temporary file
> os.system("rpm -qa >> /tmp/rpm.tmp")
> 
> I want to latter process this data. I want information about all that
> contents in a particular rpm. If someone has seen the rpm-analyser
> (http://www.maisondubonheur.com/rpm-analyzer/#about) is would be clear.
> I would like to have all the info for a particular rpm is its verion,
> Provider, Packager, Summary etc. 
> 
> Now i want to know what is rpm.py module and whether i can use in for
> this purpose or any other suggestions would be appreciated.

You don't say what exactly you want to do with the data but I suppose 
this'll get you going .. the following bit goes through all packages 
installed on your system and prints out the package name, version, summary 
+ packager:

-------
#!/usr/bin/python
                                                                                
import rpm
                                                                                
ts = rpm.TransactionSet()
for hdr in ts.dbMatch():
    print hdr['Name'], hdr['Version'], hdr['Summary'], hdr['Packager']
-------

Oh and while not terribly off-topic here either but there's a dedicated 
mailing list for rpm-python bindings here:
https://lists.dulug.duke.edu/mailman/listinfo/rpm-python-list

	- Panu -



[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux