From: sven.vermeulen@siphos.be (Sven Vermeulen) Date: Tue, 28 Nov 2017 18:06:32 +0100 Subject: [refpolicy] [PATCH 8/8] Fix regexp for templated boolean generation Message-ID: <20171128170632.11561-1-sven.vermeulen@siphos.be> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com 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