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

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





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

-sv


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