Version 1 (modified by james, 9 years ago)
move from code snippets page

Given a filename of an rpm parse out the major information that's available:

from rpmUtils.miscutils import splitFilename

myfn = 'a2ps-4.13b-57.1.el5.src.rpm'

(name, ver, rel, epoch, arch) = splitFilename(myfn)