From 8429e76474a3ee3efa00509424172a2f31faa26d Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sat, 2 May 2009 00:04:12 +0200 Subject: [PATCH] mailwhitelist ignore whitespace/comment lines. Signed-off-by: Joerg Jaspert --- daklib/regexes.py | 1 + daklib/utils.py | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) 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() -- 2.39.2