Permalink
Browse files

Updates and few docs

  • Loading branch information...
1 parent 0045dc1 commit 41d0377cc35f7668bf595c7f284cfccb73c264d3 @dagwieers committed Jan 10, 2006
Showing with 54 additions and 9 deletions.
  1. +12 −0 README
  2. +27 −0 TODO
  3. +8 −3 sarahdb.py
  4. +7 −6 sarahprint.py
View
12 README
@@ -0,0 +1,12 @@
+Sarah currently requires a stuffed directory of advisories from RHN as XML files.
+
+You can download these files automatically by using the aerrate.py script from
+Tim Rupp. Available from:
+
+ :pserver:anonymous@cdcvs.fnal.gov:/cvs/scientificlinux
+
+And issuing the following script:
+
+ for release in rh{21,el3,el4}as rh{21,el3,el4}es rh{21,el3,el4}ws rhel3{cluster,devsuite} rhel{3,4}-extras rh-desktop-{3,4} rh21aw rhshas; do
+ ./aerrate.py --source=site --type=security --release=$release
+ done
View
27 TODO
@@ -0,0 +1,27 @@
+aeratta.py
+^^^^^^^^^^
++ Parallelize the download process (use HTTP Pipelining and use
+ eg. 4 connections)
++ Allow to list a number of releases (eg. --release=rhel4as,rhel3as,rhel2.1as)
+ and remember what advisories have already been scraped (recently)
++ Use timestamp and HTTP HEAD requests to check for updates)
++ Allow to list all types of advisories (eg. --type=all or --type=critical,important)
++ Fix proxy support
++ Validate XML file after writing (some files are corrupted/unfinished)
++ Make aerrate.py executable :)
++ A lot of files do not include <severity>
+
+
+sarahdb.py
+^^^^^^^^^^
++ Define interesting queries
++ Command-line model for browsing the databases
++ Export to CSV
+
+
+sarahprint
+^^^^^^^^^^
++ Compare package-list against eratta (sqlite database)
++ Create change-request reports (containing all required updates,
+ technical information, urgency, ...)
++ Report alien packages (packages not coming from Red Hat)
View
@@ -3,6 +3,7 @@
import glob, sqlite, sys, re, os, string, shutil
from xml.dom.ext.reader import Sax2
from xml.dom.NodeFilter import NodeFilter
+import xml.sax
import sarahlib
@@ -21,8 +22,13 @@
filelist.sort()
for file in filelist:
- doc = reader.fromStream(open(file))
- walker = doc.createTreeWalker(doc.documentElement, NodeFilter.SHOW_ELEMENT, None, 0)
+ try:
+ doc = reader.fromStream(open(file))
+ walker = doc.createTreeWalker(doc.documentElement, NodeFilter.SHOW_ELEMENT, None, 0)
+ except xml.sax._exceptions.SAXParseException:
+ print '**%s**' % os.path.basename(file),
+ continue
+ print os.path.basename(file),
next = True
advrec = {}; prorec ={}; typrec = {}
@@ -99,7 +105,6 @@
if not advrec.has_key('severitylevel'):
advrec['severitylevel'] = 'unknown'
- print advrec['advid'],
# print advrec
sarahlib.insertdb(advcur, 'adv', advrec)
View
@@ -18,8 +18,10 @@
advcur.execute('select distinct advid from adv order by advid')
print 'Number of advisories:', len(advcur.fetchall())
+advcur.execute('select distinct advid from adv where severitylevel = "critical"')
+print '\tcritical:', len(advcur.fetchall()),
advcur.execute('select distinct advid from adv where severitylevel = "important"')
-print '\timportant:', len(advcur.fetchall()),
+print 'important:', len(advcur.fetchall()),
advcur.execute('select distinct advid from adv where severitylevel = "moderate"')
print 'moderate:', len(advcur.fetchall()),
advcur.execute('select distinct advid from adv where severitylevel = "low"')
@@ -31,8 +33,7 @@
typcur.execute('select typeshort from typ order by typeshort')
print 'Number of types:', len(typcur.fetchall())
-### Print all
-advcur.execute('select * from adv order by advid')
-for all in advcur.fetchall():
- print all
-
+### Debug database
+#advcur.execute('select * from adv order by advid')
+#for all in advcur.fetchall():
+# print all

0 comments on commit 41d0377

Please sign in to comment.