[Yum-devel] [PATCH] add <updated date=../> to updateinfo.xml. BZ 887935

Zdeněk Pavlas zpavlas at redhat.com
Wed Dec 19 10:21:36 UTC 2012


---
 yum/update_md.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/yum/update_md.py b/yum/update_md.py
index 4fe802b..e060911 100644
--- a/yum/update_md.py
+++ b/yum/update_md.py
@@ -318,17 +318,21 @@ class UpdateNotice(object):
 
     def xml(self):
         """Generate the xml for this update notice object"""
+
+        updated = self._md['updated']
+        updated = updated and updated != self._md['issued'] and \
+            '\n  <updated date="%s"/>' % to_xml(updated, attrib=True) or ''
         msg = """
 <update from="%s" status="%s" type="%s" version="%s">
   <id>%s</id>
   <title>%s</title>
   <release>%s</release>
-  <issued date="%s"/>
+  <issued date="%s"/>%s
   <description>%s</description>\n""" % (to_xml(self._md['from']),
                 to_xml(self._md['status']), to_xml(self._md['type']),
                 to_xml(self._md['version']), to_xml(self._md['update_id']),
                 to_xml(self._md['title']), to_xml(self._md['release']),
-                to_xml(self._md['issued'], attrib=True),
+                to_xml(self._md['issued'], attrib=True), updated,
                 to_xml(self._md['description']))
 
         if self._md['summary']:
-- 
1.7.4.4



More information about the Yum-devel mailing list