Re: createrep question

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

 





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' results/behavior.

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.

thanks,
-sv
#!/usr/bin/python

import rpm
import sys
import os

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

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

_______________________________________________
Yum mailing list
Yum@xxxxxxxxxxxxxxxxx
http://lists.baseurl.org/mailman/listinfo/yum

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux