A program in Python to get Source RPM's from cvs

Seth Vidal skvidal at fedoraproject.org
Tue Apr 7 23:01:32 UTC 2009



On Tue, 7 Apr 2009, Seth Vidal wrote:

>
>
> On Tue, 7 Apr 2009, Paty Constantino wrote:
>
>> Hi everyone,
>> 
>> I'm doing a program in Python, which for now is taking an application name 
>> and gives you the corresponding source rpm, if
>> you run the program the first thing that will appear is this:
>> 
>
> Here's the equivalent using the yum modules:
>
> import yum
> import rpmUtils.miscutils
>
> my = yum.YumBase()
> my.conf.cache = 1
> p = my.pkgSack.searchNevra(name='yum')[0]
> print rpmUtils.miscutils.splitFilename(p.sourcerpm)
>
> that should give you a tuple of name, ver, release, arch
>
>
> also see yumdownloader --source
>


one more thing - if you're going to be accessing the rpmdb and/or opening 
up local pkgs - you might consider using the yum python interface to do 
that as yum handles a lot of cases you'll eventually run into in 
rpm-python.

-sv




More information about the fedora-devel-list mailing list