From 15b389eeb5c6579d615e8d0730df29b10a0c17b7 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Mon, 18 Apr 2011 12:55:50 -0500 Subject: [PATCH] Switch to a regexp for finding requests in comments Previously looked for the reqest strings anywhere in the comment, but this breaks if someone quotes a request for some reason. Switch to using a regexp instead. --- scripts/process-git-requests/process-git-requests | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/process-git-requests/process-git-requests b/scripts/process-git-requests/process-git-requests index 85dd3e3..4e5382a 100755 --- a/scripts/process-git-requests/process-git-requests +++ b/scripts/process-git-requests/process-git-requests @@ -719,17 +719,17 @@ if __name__ == '__main__': exit(1) # Iterate over bugs + newre = re.compile('^New Package .* Request', re.MULTILINE) + changere = re.compile('^Package Change Request', re.MULTILINE) for i in bugs: firstfound = True type = '' print "Parsing bug %d - https://bugzilla.redhat.com/%d" % (i.bug_id, i.bug_id) for j in reversed(comments['bugs'][str(i.bug_id)]['comments']): - if ('New Package CVS Request' in j['text'] - or 'New Package GIT Request' in j['text'] - or 'New Package SCM Request' in j['text']): + if newre.search(j['text']): type = 'new' break - if 'Package Change Request' in j['text']: + if changere.search(j['text']): type = 'change' break firstfound = False