From db2d5e27b5295adce1b4bcf54a374e54a7100a1c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 16 Dec 2011 19:59:48 +0100 Subject: [PATCH] makefiles: Let packages inherit environment from build block. A lot of variables are often reused there and we should not pollute the root with that. --- python/pakfire/packages/lexer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/pakfire/packages/lexer.py b/python/pakfire/packages/lexer.py index 1bfcaacd6..105065539 100644 --- a/python/pakfire/packages/lexer.py +++ b/python/pakfire/packages/lexer.py @@ -803,9 +803,6 @@ class RootLexer(ExportLexer): def init(self, environ): ExportLexer.init(self, environ) - # A place to store all packages and templates. - self.packages = PackagesLexer([], parent=self) - # Import all environment variables. if environ: for k, v in environ.items(): @@ -816,6 +813,12 @@ class RootLexer(ExportLexer): # Place for build instructions self.build = BuildLexer([], parent=self) + # A place to store all packages and templates. + # The parent of this is the build block because a lot + # of relevant variables are set there and need to be used + # later. That keeps us the root lexer a bit more clean. + self.packages = PackagesLexer([], parent=self.build) + # Place for quality-agent exceptions self.quality_agent = QualityAgentLexer([], parent=self) -- 2.39.5