From: sven.vermeulen@siphos.be (Sven Vermeulen) Date: Tue, 28 Nov 2017 18:16:49 +0100 Subject: [refpolicy] [PATCH 8/8] Fix regexp for templated boolean generation In-Reply-To: <20171128170632.11561-1-sven.vermeulen@siphos.be> References: <20171128170632.11561-1-sven.vermeulen@siphos.be> Message-ID: To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com Wait with applying this one, I get other issues :-( First dinner, then continue. On Tue, Nov 28, 2017 at 6:06 PM, Sven Vermeulen wrote: > In the previous patch set, logic was added to ignore XML comments in a > template when generating the template or interface documentation, and > when that XML comment is not attributable to the template or interface > itself. This was accomplished by matching for a templated boolean or > tunable generation statement. > > Sadly, the regular expression for it did not include the necessary > backtick and (forward) tick detection which is part of such statements: > > gen_tunable(`$1_something', false) > versus > gen_tunable(domain_something, false) > > In this patch, the regular expression is updated to support this > situation. > > Signed-off-by: Sven Vermeulen > --- > support/segenxml.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/support/segenxml.py b/support/segenxml.py > index 46a4a720..2ed4068a 100644 > --- a/support/segenxml.py > +++ b/support/segenxml.py > @@ -44,7 +44,7 @@ INTERFACE = re.compile(r"^\s*(interface|template)\(`(\w*)'") > # "gen_tunable(allow_kerberos, false)" > # -> ("tunable", "allow_kerberos", "false") > BOOLEAN = re.compile(r"^\s*gen_(tunable|bool)\(\s*(\w*)\s*,\s*(true|false)\s*\)") > -TEMPLATE_BOOLEAN = re.compile(r"^\s*gen_(tunable|bool)\(\s*([\w\$]*)\s*,\s*(true|false)\s*\)") > +TEMPLATE_BOOLEAN = re.compile(r"^\s*gen_(tunable|bool)\(\s*\`?\s*([\w\$]*)\s*\'?\s*,\s*(true|false)\s*\)") > > # Matches a XML comment in the policy, which is defined as any line starting > # with two # and at least one character of white space. Will give the single > -- > 2.13.6 >