[Yum] createrep question

Seth Vidal skvidal at fedoraproject.org
Thu Feb 25 21:29:31 UTC 2010

On Thu, 25 Feb 2010, Kidwell,jr, Jack wrote:

> The master himself! Thanks for the quick reply.
> Since it's COTS, I cannot provide the RPM. The vendor appears to offer an RPM as an afterthought; their principal market is Windows.
> I've patched our createrepo to relax this behavior with a command line option. Would this be useful to others?

I suspect 'relaxing' that behavior will result in other 'interesting' 

If you cannot provide the actual rpm - how about providing the header of 
the rpm?

run this script against the rpm, it'll output a pkgname.hdr file - send me 
that file.

-------------- next part --------------

import rpm
import sys
import os

def returnHdr(ts, package):
    """hand back the rpm header or raise an Error if the pkg is fubar"""
        fdno = os.open(package, os.O_RDONLY)
    except OSError, e:
        print "Error opening file"
        hdr = ts.hdrFromFdno(fdno)
    except rpm.error, e:
        print "Error opening package"
    if type(hdr) != rpm.hdr:
        print "Error opening package"
    return hdr

ts = rpm.TransactionSet()
hdr = returnHdr(ts, sys.argv[1])
fn = '%s.hdr' % hdr['name']
fo = open(fn, 'w')

More information about the Yum mailing list