]> git.ipfire.org Git - pakfire.git/commitdiff
Allow templates to be included from parent and containing numbers.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Oct 2011 19:38:42 +0000 (19:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 11 Oct 2011 19:44:21 +0000 (19:44 +0000)
python/pakfire/packages/lexer.py

index 99a71ae7d21c250f46ab420b5697b39f7381a872..dc2bc9d3694920c512f035f813c20bcf5101bc46 100644 (file)
@@ -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