SVN: security/cve_reader.py

shadzik shadzik at pld-linux.org
Mon Oct 8 04:20:59 CEST 2007


Author: shadzik
Date: Mon Oct  8 04:20:59 2007
New Revision: 8802

Modified:
   security/cve_reader.py
Log:
- add RSS functionality, hurrey


Modified: security/cve_reader.py
==============================================================================
--- security/cve_reader.py	(original)
+++ security/cve_reader.py	Mon Oct  8 04:20:59 2007
@@ -12,6 +12,7 @@
 import readline
 import time
 import datetime
+import PyRSS2Gen
 
 # Changes go here
 log = '/cvsroot/SPECS/commits.log'
@@ -146,7 +147,8 @@
 	EpochSeconds = time.mktime(t.timetuple())
 	now = datetime.datetime.fromtimestamp(EpochSeconds)
 	f = open(h_page, 'w')
-	f.write("<p align=\"center\">Generated on: %s</p>" % now.ctime())
+	f.write("<p align=\"center\">Generated on: %s<br/>\n" % now.ctime())
+	f.write("<a href=\"http://security.pld-linux.org/pld_security.xml\">Get the RSS feed!</a></p>\n")
 	f.write("<table><tr>\n")
 	f.write("<td width=\"50\"><b>Date</b></td>\n")
 	f.write("<td width=\"50\"><b>SPEC</b></td>\n")
@@ -188,8 +190,31 @@
 					break
 	return 0	
 
+def genRSS():
+	item = []
+	for i in range(len(specs)):
+		item.append(
+			PyRSS2Gen.RSSItem(
+				title = "New CVE fixes for %s" % specs[i],
+				link = "http://security.pld-linux.org/pld_security.xml",
+				description = "%s on rev. %s resolves: %s" % (specs[i], revs[i], cves[i]),
+				guid = PyRSS2Gen.Guid("http://security.pld-linux.org/"),
+				pubDate = datetime.datetime.now()),
+		)
+	rss = PyRSS2Gen.RSS2(
+		title = "PLD Security Feed",
+		link = "http://security.pld-linux.org/",
+		description = "The latest security fixes in PLD's RPMs",
+
+		lastBuildDate = datetime.datetime.now(),
+		items = item
+	)
+	rss.write_xml(open("www/pld_security.xml", "w"))
+
+
 # now call them
 genPageHeader()
 #rsync()
 parse()
 genPageFooter()
+genRSS()


More information about the pld-cvs-commit mailing list