From d4827db58b195892de76fd3db3f4e025869375da Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 11 Oct 2011 19:38:42 +0000 Subject: [PATCH] Allow templates to be included from parent and containing numbers. --- python/pakfire/packages/lexer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/pakfire/packages/lexer.py b/python/pakfire/packages/lexer.py index 99a71ae7d..dc2bc9d36 100644 --- a/python/pakfire/packages/lexer.py +++ b/python/pakfire/packages/lexer.py @@ -45,13 +45,13 @@ LEXER_DEFINE_END = LEXER_BLOCK_END LEXER_PACKAGE_BEGIN = re.compile(r"^package ([A-Za-z0-9_\-\+\%\{\}]+)$") LEXER_PACKAGE_LINE = LEXER_BLOCK_LINE LEXER_PACKAGE_END = LEXER_BLOCK_END -LEXER_PACKAGE_INHERIT = re.compile(r"^template ([A-Z]+)$") +LEXER_PACKAGE_INHERIT = re.compile(r"^template ([A-Z0-9]+)$") LEXER_SCRIPTLET_BEGIN = re.compile(r"^script ([a-z]+)\s?(/[A-Za-z0-9\-\_/]+)?$") LEXER_SCRIPTLET_LINE = LEXER_BLOCK_LINE LEXER_SCRIPTLET_END = LEXER_BLOCK_END -LEXER_TEMPLATE_BEGIN = re.compile(r"^template ([A-Z]+)$") +LEXER_TEMPLATE_BEGIN = re.compile(r"^template ([A-Z0-9]+)$") LEXER_TEMPLATE_LINE = LEXER_BLOCK_LINE LEXER_TEMPLATE_END = LEXER_BLOCK_END @@ -675,7 +675,7 @@ class PackageLexer(TemplateLexer): # Get template from parent. try: - return self.root.templates[self._template] + return self.parent.templates[self._template] except KeyError: raise LexerError, "Template does not exist: %s" % self._template -- 2.39.5