]> err.no Git - dak/commitdiff
whitelist patch
authorJoerg Jaspert <joerg@debian.org>
Fri, 13 Feb 2009 22:05:58 +0000 (23:05 +0100)
committerJoerg Jaspert <joerg@debian.org>
Fri, 13 Feb 2009 22:05:58 +0000 (23:05 +0100)
this needs module re for now

Signed-off-by: Joerg Jaspert <joerg@debian.org>
daklib/regexes.py
daklib/utils.py

index 96f6c8e9612c7fb99463ef73dd7332435bb74cd5..ee26430ce8673b1908b5a948cce877898328e4f7 100755 (executable)
@@ -105,4 +105,5 @@ re_gpg_fingerprint = re.compile(r"^fpr:+(.*):$", re.MULTILINE);
 re_user_address = re.compile(r"^pub:.*<(.*)@.*>.*$", re.MULTILINE);
 re_user_mails = re.compile(r"^(pub|uid):[^rdin].*<(.*@.*)>.*$", re.MULTILINE);
 re_user_name = re.compile(r"^pub:.*:(.*)<.*$", re.MULTILINE);
+re_re_mark = re.compile(r'^RE:')
 
index 85ef0b5573b86649c1e57030c37332d4263e6b7f..373910c4783393361ca046710cfe06d8f714ca65 100755 (executable)
@@ -37,11 +37,12 @@ import stat
 import apt_pkg
 import database
 import time
+import re
 import email as modemail
 from dak_exceptions import *
 from regexes import re_html_escaping, html_escaping, re_single_line_field, \
                     re_multi_line_field, re_srchasver, re_verwithext, \
-                    re_parse_maintainer, re_taint_free, re_gpg_uid
+                    re_parse_maintainer, re_taint_free, re_gpg_uid, re_re_mark
 
 ################################################################################
 
@@ -607,11 +608,10 @@ def send_mail (message, filename=""):
 
         whitelist = [];
         whitelist_in = open_file(Cnf["Dinstall::MailWhiteList"])
-        RE_mark = re.compile(r'^RE:')
         try:
             for line in whitelist_in:
-                if RE_mark.match(line):
-                    whitelist.append(re.compile(RE_mark.sub("", line.strip(), 1)))
+                if re_re_mark.match(line):
+                    whitelist.append(re.compile(re_re_mark.sub("", line.strip(), 1)))
                 else:
                     whitelist.append(re.compile(re.escape(line.strip())))
         finally: