From: Joerg Jaspert Date: Fri, 1 May 2009 22:04:12 +0000 (+0200) Subject: mailwhitelist X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=8429e76474a3ee3efa00509424172a2f31faa26d;p=dak.git mailwhitelist ignore whitespace/comment lines. Signed-off-by: Joerg Jaspert --- diff --git a/daklib/regexes.py b/daklib/regexes.py index ee26430c..6fd0c81d 100755 --- a/daklib/regexes.py +++ b/daklib/regexes.py @@ -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-[^/]+/") diff --git a/daklib/utils.py b/daklib/utils.py index c40fe8e0..951270b5 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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()