File yum-3.2.25-add-sourcerpm-for-old-yum.patch of Package yum
--- ./yum/packages.py.orig 2010-05-20 10:47:50.000000000 +0000
+++ ./yum/packages.py 2010-05-20 10:48:03.000000000 +0000
@@ -894,6 +894,12 @@ class YumAvailablePackage(PackageObject,
if self.sourcerpm:
msg += """ <rpm:sourcerpm>%s</rpm:sourcerpm>\n""" % misc.to_xml(self.sourcerpm)
+ else:
+ # old yum complains if there is no sourcerpm element. we misuse the checksum
+ # field to find out if we create metadata for old yum versions
+ (csum_type, csum, csumid) = self.checksums[0]
+ if csum_type == "sha":
+ msg += """ <rpm:sourcerpm/>\n"""
msg +=""" <rpm:header-range start="%s" end="%s"/>""" % (self.hdrstart,
self.hdrend)
msg += self._dump_pco('provides')