[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'
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
-------------- next part --------------
#!/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()
More information about the Yum
mailing list