The below patch is against 1.1.31.  It does two things:

1. fixes a bug where repo-rss crashed when dealing with packages that
   contain non-ASCII in their descriptions.

2. reverse sorts the results by buildtime so the most recent package
   builds will be first in the RSS feed.

Thanks!


diff -Nur yum-utils-1.1.31.orig/repo-rss.py yum-utils-1.1.31/repo-rss.py
--- yum-utils-1.1.31.orig/repo-rss.py   2011-08-10 11:20:19.000000000 -0400
+++ yum-utils-1.1.31/repo-rss.py        2013-01-17 17:39:19.980320000 -0500
@@ -144,7 +144,7 @@
             changelog += '%s - %s\n%s\n\n' % (date, author, desc)
         description = '<p><strong>%s</strong> - %s</p>\n\n' % 
(escape(pkg.name), 
                                             
escape(pkg.returnSimple('summary')))
-        description += '<p>%s</p>\n\n<p><strong>Change Log:</strong></p>\n\n' 
% escape(pkg.returnSimple('description').encode('utf-8').replace("\n", "<br 
/>\n"))
+        description += '<p>%s</p>\n\n<p><strong>Change Log:</strong></p>\n\n' 
% 
escape(to_unicode(pkg.returnSimple('description')).encode('utf-8').replace("\n",
 "<br />\n"))
         description += escape('<pre>%s</pre>' % 
escape(to_unicode(changelog).encode('utf-8')))
         item.newChild(None, 'description', description)
         
@@ -222,6 +222,8 @@
             sys.exit(1)
     
     recent = my.getRecent(days=days)
+    recent.sort(key=lambda pkg: pkg.returnSimple('buildtime'))
+    recent.reverse()
     if options.groups:
         comps = Comps()
         for repo in my.repos.listEnabled():
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to