]> git.decadent.org.uk Git - dak.git/commitdiff
mailwhitelist
authorJoerg Jaspert <joerg@debian.org>
Fri, 1 May 2009 22:04:12 +0000 (00:04 +0200)
committerJoerg Jaspert <joerg@debian.org>
Fri, 1 May 2009 22:04:12 +0000 (00:04 +0200)
ignore whitespace/comment lines.

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

index ee26430ce8673b1908b5a948cce877898328e4f7..6fd0c81d0955ae4bbe8dc3f94aa9aab815891675 100755 (executable)
@@ -35,6 +35,7 @@ re_fdnic = re.compile(r"\n\n")
 re_bin_only_nmu = re.compile(r"\+b\d+$")
 
 re_comments = re.compile(r"\#.*")
+re_whitespace_comment = re.compile(r"^\s*(#|$)")
 re_no_epoch = re.compile(r"^\d+\:")
 re_no_revision = re.compile(r"-[^-]+$")
 re_arch_from_filename = re.compile(r"/binary-[^/]+/")
index c40fe8e0efafcde03c217151f647c1a1672e3f97..951270b5d2074fc380cfaba696d16b4d56bb010d 100755 (executable)
@@ -43,7 +43,8 @@ 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_re_mark
+                    re_parse_maintainer, re_taint_free, re_gpg_uid, re_re_mark, \
+                    re_whitespace_comment
 
 ################################################################################
 
@@ -616,10 +617,11 @@ def send_mail (message, filename=""):
         whitelist_in = open_file(Cnf["Dinstall::MailWhiteList"])
         try:
             for line in whitelist_in:
-                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())))
+                if not re_whitespace_comment.match(line):
+                    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:
             whitelist_in.close()