Author: shadzik
Date: Fri Nov  2 19:07:28 2007
New Revision: 8972

Modified:
   security/cve_reader.py
Log:
- more fixes!!


Modified: security/cve_reader.py
==============================================================================
--- security/cve_reader.py      (original)
+++ security/cve_reader.py      Fri Nov  2 19:07:28 2007
@@ -76,18 +76,6 @@
                        cvslog = 1
                        
                        while (i + cvslog < len(lines) and not 
re.match('^Index\:.*\.spec', lines[i + cvslog])):
-                               # if CVE entries were added later in another 
revision, search for the real revision they
-                               # apply to in the spec not in commits.log
-                               if re.findall('^@@', lines[i+cvslog]):
-                                       # remember the next line after "@@"
-                                       mem = lines[i+cvslog+1]
-                                       # and parse the spec instead of 
commits.log
-                                       try:
-                                               d = parseSPEC(spec, 
mem).split(" ")
-                                               r_rev = d[0]
-                                               r_date = d[1]
-                                       except(AttributeError):
-                                               pass
                                if re.match('.*Revision.*', lines[i+cvslog]):
                                        # Set new revison data
                                        p = lines[i+cvslog].split(" ")
@@ -106,7 +94,18 @@
                                                cve_list = 
re.findall("CVE-[0-9\-]+", lines[i+cvslog])
                                                for iter in 
range(len(cve_list)):
                                                        
cve.append(cve_list[iter])
-                               
+                                       # if CVE entries were added later in 
another revision, search for the real revision they
+                                       # apply to in the spec not in 
commits.log
+                                       if re.findall('^@@', lines[i+cvslog]):
+                                               # remember the next line after 
"@@"
+                                               mem = lines[i+cvslog+1]
+                                               # and parse the spec instead of 
commits.log
+                                               try:
+                                                       d = parseSPEC(spec, 
mem).split(" ")
+                                                       r_rev = d[0]
+                                                       r_date = d[1]
+                                               except(AttributeError):
+                                                       pass                    
        
                                cvslog = cvslog + 1
                        
                        if len(cve) > 0:
@@ -138,15 +137,17 @@
                for i in range(len(lines)):
                        ind = 1
                        if lines[i] == mem:
-                               while not lines[i-ind] == "$Log$":
+                               while lines[i-ind] != "$Log$":
                                        if re.match('^Revision.*', 
lines[i-ind]):
                                                p = lines[i-ind].split(" ")
                                                real_rev = p[1]
                                                date = p[3]
+                                               return real_rev + " " + date
+                                               f.close()
+                                               break
                                        ind = ind + 1
                f.close()
-               os.remove("%s%s" % ( CVSMODULE, spec))
-               return real_rev + " " + date
+               os.remove("%s%s" % (CVSMODULE, spec))
        else:
                return
 
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to