aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Buchholz <rbu@gentoo.org>2008-10-19 20:02:40 +0000
committerRobert Buchholz <rbu@gentoo.org>2008-10-19 20:02:40 +0000
commit4bdcc737fff423b75029329fae2d457fa8fbb5c4 (patch)
tree9162eaee1fd818c60e9271ba82b193cf605bde54
parentReverting two NFU/BUGs since we might be affected (diff)
downloadsecurity-4bdcc737fff423b75029329fae2d457fa8fbb5c4.tar.gz
security-4bdcc737fff423b75029329fae2d457fa8fbb5c4.tar.bz2
security-4bdcc737fff423b75029329fae2d457fa8fbb5c4.zip
Improve tools: Better whiteboard heuristics for target, guess_name for cve
svn path=/; revision=819
-rwxr-xr-xbin/target3
-rw-r--r--lib/python/cvetools.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/bin/target b/bin/target
index e273be1..2ce0af6 100755
--- a/bin/target
+++ b/bin/target
@@ -114,7 +114,8 @@ def cc_arches_to(bugno, username, message, cc_add, auth):
whiteboard = bug_xml.find('//status_whiteboard')
if not whiteboard is None:
whiteboard = whiteboard.text
- new_whiteboard = re.sub("(ebuild|upstream|stable\?)", "stable", whiteboard)
+ new_whiteboard = re.sub("(ebuild|upstream|stable)\??", "stable", whiteboard)
+ new_whiteboard = re.sub("stable/stable", "stable", new_whiteboard)
else:
whiteboard = "(empty)"
new_whiteboard = "?? [stable]"
diff --git a/lib/python/cvetools.py b/lib/python/cvetools.py
index 0a6506a..69899cf 100644
--- a/lib/python/cvetools.py
+++ b/lib/python/cvetools.py
@@ -57,7 +57,10 @@ class CVEData:
return self.cvedata[cve]['refs']
def guess_name_for(self, cve):
- refs = self.cvedata[cve]['refs']
+ try:
+ refs = self.cvedata[cve]['refs']
+ except KeyError:
+ return {}
SAs = []
names = {}
for url in refs:
@@ -70,7 +73,7 @@ class CVEData:
match = re.findall(r'<b>Provided and/or discovered by</b>:(.+?)<b>', html, flags = re.S)
if match:
text = re.sub('<.*?>', '', match[0])
- names[SAid] = [re.sub(r'^[\d,) ]*(.* credits)?', '', line).strip() for line in text.split('\n')]
+ names[SAid] = [re.sub(r'in a .* bug report', '', re.sub(r'^[\d,) ]*(.* credits|Reported by)?', '', line)).strip(' \n.') for line in text.split('\n')]
return names